Wednesday 13 February 2019

Powershell cmdlet syntax

Over the years I have been using powershell and Windows Powershell ISE as my default editor. Whenever I was stuck on not knowing the syntax for a cmdlet I would use the Commands windows and find my cmdlet then select Show Details
You will get a expanded menu of all the possible syntax/s that are for the cmdlet. Selecting the question mark then brings up more detailed information such as description, syntax and examples.

There are times where I work straight on the command line and discovered that there are equivalent commands available to help display this information

Get-Command Connect-VIServer -Syntax

This would output the syntax/s the cmdlet can accept


Another useful command to use it 

Get-Help Connect-VIServer -Examples

This would output some examples to help you on how to use this cmdlet
Below are a few more cmdlets which provides further information about a cmdlet which maybe useful

Get-Help Connect-VIServer -Detailed
Get-Help Connect-VIServer -Full
Get-Command Connect-VIServer -ShowCommandInfo




No comments:

Post a Comment

New Azure KMS IP and domain Addresses for activation

For Windows virtual machines deployed into Azure using marketplace images you may have created rules in your NSG or firewalls to allow the s...