Show-Command is a new way for researching the parameters and syntax of
other PowerShell cmdlets. In this tutorial you will see how to filter
using 'Modules', then examine the cmdlet properties in a 'Form'.
I see this as a learning tool to compliment Get-Help. The idea
behind Show-Command is to provide a sand box for testing another PowerShell cmdlet; I have chosen
to examine the parameters for Get-Process, but you could experiment with any
cmdlet.
# Windows PowerShell 3.0 New Cmdlet Show-Command Get-Process
Note 1:
The rhythm is: Show-Command cmdlet2.
Results of Show-Command The idea is that you can test various parameters, such as Id, or computer
name.
Note 2: Observe how you can 'Run' the experiment, or if
that button is greyed out, you can 'Copy', then paste from the form into the PowerShell
GUI.
Note 3: It's worth running Show-Command just to remind
oneself of the 'Common Parameters'.
Note 4: If you are experimenting for real I
recommend opening the corresponding interface, in this case Task Manager;
then I compare the Show-Command form with the Task Manager Process tab.
Show-Command with Get-ChildItem
Here is another example which shows how you can learn more about the
parameters of a cmdlet, this time it's gci (Get-ChildItem).
Note 5: See from the screenshot how the
PowerShell Show-Command
helps reveal
parameters such as -recurse and -force. If you do this for
real scroll up (or down) to see more options.
Note 6: Remember that you have the option to 'Run', or
'Copy'. If you choose copy then I suggest you open another
'New' script page and paste, that's the easiest way to see what Show-Command has produced.
The above example would paste: Get-ChildItem -Path C:\CP -Recurse
(Assuming you added
a Path parameter in addition to the ticking the Recurse box).
For more information see the PowerShell 3.0
ISE.
Guy
Recommends: WMI Monitor and It's Free!
Windows Management Instrumentation (WMI) is one of the hidden
treasures of Microsoft operating systems. Fortunately, SolarWinds
have created a
Free WMI Monitor so that you can discover these gems of performance
information, and thus improve your PowerShell scripts. Take the guess work out of which WMI counters to use when scripting the
operating system, Active Directory or Exchange Server.
Auto-Complete is a nifty command to learn more about Windows PowerShell. As you
begin to type a cmdlet, say 'Show-' you see a pick-list of likely nouns to append to your
verb.
Microsoft also provide a useful way of grouping cmdlets:
Import users from a spreadsheet. Just provide a list of the
users with their fields in the
top row, and save as .csv file. Then launch this FREE utility and match
your fields with AD's
attributes, click to import the users. Optionally, you can
provide the name of the OU where the new accounts will be born.
There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:
Note 7: Much to my surprise, I discovered these two
cmdlets: Show-EventLog and Show-ControlPanelItem.
»
Summary of PowerShell 3.0's Show-Command
This tutorial explains how to employ Show-Command, which is one of PowerShell 3.0's
new cmdlets. Beginners may find the results a little perplexing
and advanced PowerShell users may have better ways of extracting the
same information; but for intermediates, I think that PowerShell's
Show-Command is ideal for discovering more about other cmdlets.
If you like this page then please share it with your friends