The Azure drive

Another cool feature of PowerShell in Azure Cloud Shell is the Azure PSDrive, provided with SHiPS (https://github.com/powershell/ships). It is a great module to build a hierarchical data structure that can be explored through the provided cmdlets, such as Get-ChildItem. The following screenshot shows SHiPS in action navigating the Azure drive.

You can simply navigate through your subscriptions, resource groups, and resources just as you would navigate a filesystem. SHiPS displays containers and leafs, letting you navigate through all of the containers until you are left with the leafs. In the following screenshot, we simply list all compute resources of a subscription to then pipe them to the Start-AzureRmVm cmdlet in order to start our machines.

Your leafs can be piped to other Azure cmdlets; for example, to start or stop IaaS workloads. This makes PowerShell in Azure Cloud Shell very versatile.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset