Three Key Commands
There are three commands that are very useful when you first experiment with PowerShell:
- Get-Command
- Get-Help
- Get-Member
Get-Command
Get-Command lists all the noun-verb pairs, the cmdlets. You can filter the list by using the wildcard star (*).
Here are three examples:
Get-Command get* Get-Command set* Get-Command write*
Get-Help
The Get-Help command obviously gives you some assistance. Simply follow it with the command in question.
You'll probably want to also include "-detailed" to get more information and examples of how to use the command.
Here are some help examples:
Get-Help Out-File -detailed Get-Help Get-Item -detailed Get-Help Remove-Item -detailed
Get-Member
The Get-Member command helps you discover more about PowerShell's objects. It's basically like right-clicking an object in the regular Windows GUI and selecting Properties.
It lists the properties and methods associated with any given object. Unlike other commands, this one comes after the object.
For instance:
Get-Item... | get-Member Get-Location... | get-Member Get-Item... | get-Member