SharePoint Tidbit – GUI for PowerShell commands


Hello All,

Earlier this week I was going thru my RSS feed and found an article about the cmdlet Show-Command and thought it was cool enough that I wanted to tell you about it.

This cmdlet allows you to have a GUI for your cmdlet’s so we can get something like this, as you can see this cmdlet is a fantastic tool as you learn how to use PowerShell and it works with not only your basic cmdlet’s but your SharePoint cmdlet’s as well.

Capture4

This code opens a GUI for the cmdlet Get-SPSite:

Show-Command get-spsite

As you can see the GUI will provide you with the available parameters and space to fill in what you would like to have in there, as well you can expand the Common parameters if you want to use parameters like ErrorAction

Capture5

Once you fill in the blanks with the information that you think is correct, you can do 1 of these 2 things.  You can run the command or you can copy, when you run it then the cmdlet is copied to your PowerShell window and executed with the parameters you provided it.  But if you choose copy then it will copy the cmdlet with parameters to your clipboard and you can paste it anywhere you want.

Capture6

NOTE: The Show-command will separate parameter sets into different tabs as you can see Get-SPSite has 4 which are AllSitesInWebApplication, AllSitesInContentDB, AllSitesInIdentity, and AllSitesInSiteSubscription

Pax

Comments (0)

Skip to main content