Executive Summary:
| PowerShell’s Get-Command and Get-Help cmdlets sometimes don’t provide as much usage information as necessary. The author’s Get-Usage script displays usage for more categories of command types than Get-Command or Get-Help. |
One of PowerShell's greatest features is its discoverability: You can learn about PowerShell as you use it. For example, the PowerShell command
Get-Command -Syntax <cmdlet-name>
(where cmdlet-name is the name of a specific PowerShell cmdlet) lets you instantly see exactly how to use a cmdlet.
To illustrate how this command works, let's look at a specific cmdlet. Suppose you want to use the Start-Sleep cmdlet to pause script execution for 2 seconds, but you're uncertain how Start-Sleep works. Some sleep commands take a time to pause in seconds, whereas other commands take a time in milliseconds. If you run the command . . .