The Azure PowerShell Extensions module (AzureExt) for Windows PowerShell has seen another interesting update! Let’s take a look at some of the high-level changes:
- External dependencies have been completely removed
- The module now supports PowerShell ISE Snippets for Azure Resource Manager (ARM) Resources
- New command: Remove-AzureRmResourceGroupGui
- New command: Start-AzureRM
Check out Art of Shell’s Microsoft Azure Resource Manager (ARM) training course, if you’re provisioning cloud resources on Microsoft Azure!
External Dependencies
Previously, the Azure PowerShell Extensions module took a dependency on the TabExpansion++ PowerShell module. This was necessary to provide auto-completer functions for parameter values in the core Azure PowerShell module. Because PowerShell version 5.0 provides the Register-ArgumentCompleter command out of the box, we have changed the code to use this command, instead of TabExpansion++. As long as you’re running PowerShell version 5.0, you’ll be able to use the auto-completion (Intellisense) functionality for the Azure PowerShell module.
Give it a try, and let us know what you think!
Get-AzureRmResource -ResourceName {CTRL + SPACE} New-AzureRmVirtualNetwork -ResourceGroupname {CTRL + SPACE}
ARM PowerShell ISE Snippets
If you’re interested in developing a Microsoft Azure Resource Manager (ARM) JSON Template, and would prefer not to leave the PowerShell ISE environment each time you need to create a new resource, then you can import the snippets directly from the AzureExt PowerShell module. Simply type Import-IseSnippet -Module AzureExt, and you will automatically have access to a variety of ISE snippets that will help you to rapidly declare ARM resources inside a template file. While the PowerShell ISE doesn’t have native support for JSON, you can still store the JSON text in a PowerShell here-string, and use a command such as Set-Content or Out-File to write it to a JSON text file for deployment. For an ideal ARM JSON Template authoring experience, I encourage you to check out Microsoft’s Visual Studio Code, and install the Azure Resource Manager Extension for it.
Here’s a demonstration of the snippets in action.
Thought #PowerShell ISE wasn’t for authoring #Azure Resource Manager (ARM) templates? Try again. =) #cloud #DevOps pic.twitter.com/YrrXPgVsAK
— Trevor Sullivan (@pcgeek86) April 24, 2016
Removing Multiple Azure Resource Manager Resource Groups
Do you need to clean up multiple Azure Resource Manager (ARM) Resource Groups? If so, and you want to avoid a lot of typing, you’ll want to check out this handy Remove-AzureRmResourceGroupGui command. This command enables you to visually select one or more Resource Groups to delete, instead of requiring you to type out a lengthy, complicated command, to filter and delete them on the command line. As of this writing, the Microsoft Azure Portal also doesn’t allow you to delete multiple Resource Groups at a time, which can turn out to be an expensive time-cost. By using this new command, you can “set and forget” and it will handle deleting all the Resource Groups you asked it to, while you go refill your coffee.
Create / Load your cached Azure Profile
Are you tired of typing Login-AzureRmAccount every time you start PowerShell, followed by your Azure credentials? If so, install the Azure PowerShell Extensions, and use the Start-AzureRm command to cache your profile locally. Each time you run PowerShell, simply type Start-AzureRm, and your cached Azure profile will be loaded!
The Start-AzureRm command originally started out as a function that I added to my profile script, but I decided to incorporate it into the Azure PowerShell Extensions project instead, because modularity is better!
Development of the Azure PowerShell Extensions project takes place on GitHub.