Random Tip of the Day

by Apr 26, 2010

Get-Random has a dual purpose. It can provide you with a random number and also pick random elements from a collection. So, if you want to get a new random PowerShell "Tip of the Day," you should try this:

Get-Help about_* | Get-Random | Out-Host -Paging

Likewise, if you want to learn a new random PowerShell cmdlet each day, you can use this:

Get-Command -CommandType Cmdlet | Get-Random | Get-Help

Many Get-*-Cmdlets, such as Get-EventLog or Get-Process, will output data in columns and support parameters named like these columns. So if you need to filter the results, you should just look at the column you want to filter on, then use the parameter named like the column, and add your filter criteria:

Get-EventLog System -EntryType Error
Get-Process -ID $pid

Twitter This Tip! ReTweet this Tip!