Quantcast
Viewing all articles
Browse latest Browse all 6

Answer by Jon Crowell for How to get list of all Azure VMs in Powershell

Based on David's answer, I wrote the following script that combines the two lists of VMs:

Switch-AzureMode -Name AzureServiceManagement#ResourceGroupName will be blank for these$classicVms = Get-AzureVM | select Name, ServiceName, ResourceGroupNameSwitch-AzureMode -Name AzureResourceManager    #ServiceName will be blank for these$armVms = Get-AzureVM | select Name, ServiceName, ResourceGroupName $allVms = $classicVms + $armVms$allVms

When you run this, you'll get a warning that Switch-AzureMode is deprecated.

WARNING: The Switch-AzureMode cmdlet is deprecated and will be removed in a future release

The deprecation is part of a breaking change. You can read the details here: Deprecation of Switch-AzureMode.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>