Windows #Powershell Bits

Been stuck in a meeting and wanted to look a bit interested in that I was taking notes, so I have look around Powershell on my Windows 7 laptop.

Found some kewl stuff.  Lets start with:

  • Get-Hotfix
    The Get-Hotfix cmdlet gets the hotfixes that have been applied to the local computer or to remote computers by Component-Based Servicing.
  • Get-Random
    The Get-Random cmdlet gets a randomly selected number. If you submit a collection of objects to Get-Random, it gets one or more randomly selected objects from the collection.

Now Get-Random is really funky.  You can run it like:

  • Get-Random -Maximum 99
    This will get you a number between 0 and 99
  • Dir | Get-Random
    Will pick a random file from the dir
  • Dir | Get-Random -Count 3
    Will pick 3  random files from the dir
  • 1..99 | Get-Random -Count 3
    This will get 3 random numbers between 0 and 99

How kewl is that?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.