Freigeben über


Quick Tip while working with Azure PowerShell

Azure PowerShell is an ocean of commands. Remembering them while working is next to impossible. Azure PowerShell gives you an elegant option to find out what you need. Few things I use while try to explore what’s there for me while exploring the options.

Use Get-Help

Get-Help is a powerful command. You can use it in conjunction with wildcard (*) search. For example if you want to see what all commands are there related to VM, use

> Get-Help *AzureRm*VM*

This would get you all the commandlets which has text “AzureRm” followed by anything then “VM” and anything after that. The result contains quite a lot of search. Let’s pickup the command New-AzureRMVM

You can now use Get-Help with this specific command.

> Get-help New-AzureRmVM

It would tell you syntax. There is more to it. Let’s explore the switches. Get-Help comes with quite a lot of switches,

image

Out of which I like,

Full: This gives the full documentation including the details about the parameters like their default values ect including extensive examples.

ShowWindow: This one I like. Instead of showing the help in command console it displays things in separate popup window which you can run side by side and copy things from there. You can even filter by clicking “Settings” in the popup window and select things you want to see.

> Get-Help –ShowWindow

image

Examples: One or few examples on how this commandlet can be used in script.

Happy exploring.

Namoskar!!!