Learning Powershell with Show-Command

4

July 11, 2019 by Kenneth Fisher

Years ago I blogged about how I like to use the SSMS scripting feature to learn how to do things. Well now I’m starting to learn Powershell and it turns out there is a GUI here as well that will help me learn to script. At least in a very basic way. For example, if I want to see what parameters are actually available for Get-Help and maybe script out a template to work with then I can do this:

Show-Command Get-Help

Each tab (AllUsersView, DetailedView, Examples etc) is a different set of parameters and will not work together. So you have to pick a tab and stick with it. The first problem I’m running into is that I don’t know what the various parameters mean. I’m going to hit that help button on the top right.

Now I have the window version of the help screen. Which if you look closely at tab list you’ll see is an option for the help command. I can now scroll down and see what my various options are. I’m going to go to the Show-Window tab and pull up the help for the Show-Command cmdlet (inception anyone?).

And then if I hit the Copy button I get the command with the parameters (no abbreviations or aliases) put into the clipboard.

Get-Help -ShowWindow -Name Show-Command

-ShowWindow brings up that nice little window for the help.
-Name is the name of the command I want.

I can of course also just hit the Run button and run the command, but that kind of ruins the purpose of it in my opinion.

Last but not least if I want to see the list of possible Common Parameters I can hit the down arrow at the bottom and expand them. I’m going to check Verbose.

And now when I hit copy I get this:

Get-Help -ShowWindow -Name Show-Command -Verbose

Pretty cool right? This will probably be my most used command over the next few months.

4 thoughts on “Learning Powershell with Show-Command

  1. IM Fletcher says:

    That’s interesting. I usually end up Googling for 30 minutes trying to track down what I want to do. It’s nice to see some useful help. Thanks for posting!

  2. […] Kenneth Fisher walks through the Show-Command cmdlet in Powershell: […]

  3. […] remembering seeing it before.  Then a couple of weeks ago Kenneth Fisher ( b | t ) post a blog about this command.  I like how Kenneth related the Show-Command in PowerShell to generating […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2,530 other followers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: