PowerShell – Where to start
So where to start. Well as always you start with the help!
Now that is something you don’t want to hear, but it is the best way to get to know Powershell.
So how do you find this help. All you have to do is type help in the Powershell Console and it will tell you how to get help about a cmdlet.
For example to get help file for cmdlet Get-Process, type Help Get-Process or
just Get-Process -?.
This is however nothing new for those who have been using the command prompt before. What’s may be interesting to know is how to interpret the character surrounding the parameters in the help. For instance Get-Process has the following first paramaterset.
Get-Process [[-Name] <String[]>] [-ComputerName <String[]>] [-FileVersionInfo] [-Module] [<CommonParameters>]
Here we have the characters [] and <> surrounding a parameter or value or both. There is all so the open and closed brackets [] that does not contain a value.
The [] characters surrounding a parameter means that it is optional. The <> characters indicate that this is the value for the parameter. And the
[] brackets means that this parameter accepts multiple values.
To display all the help uses the switch -Full. To just view the examples of a command, use the switch -Examples.
As always in Powershell use the autocomplete feature to find out the specific parameters available for each cmdlet.