是否有任何脚本或命令可以在 PowerShell 的帮助下在 Excel 表中获取所有 azure VM 的报告,其中包括与该、RG 和订阅相关的所有标签?
You can implement the Powershell Script by following steps:
Install az
modules in your local machine (Install-Module -Name 'Az' -allowclobber -scope currentuser)
Connect to your Azure subscription using this cmd (connect-Azaccount).
Use Get-AzVm
Get-AzVM (Az.Compute) | Microsoft Docs to get the list of VM under the subscription and assign the output to a variable and by using the for each loop about Foreach - PowerShell | Microsoft Docs iterate the list in the variable and project the output to csv file using the export-csv .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.