[英]How to get the details of the all Azure VM's with respective all Tag associated with it in excel sheet with the help of powershell?
是否有任何脚本或命令可以在 PowerShell 的帮助下在 Excel 表中获取所有 azure VM 的报告,其中包括与该、RG 和订阅相关的所有标签?
You can implement the Powershell Script by following steps:您可以通过以下步骤实现 Powershell 脚本:
Install az
modules in your local machine (Install-Module -Name 'Az' -allowclobber -scope currentuser)在本地计算机上安装
az
模块(Install-Module -Name 'Az' -allowclobber -scope currentuser)
Connect to your Azure subscription using this cmd (connect-Azaccount).使用此 cmd (connect-Azaccount) 连接到您的 Azure 订阅。
Use Get-AzVm
Get-AzVM (Az.Compute) |使用
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获取订阅下的 VM 列表并将输出分配给一个变量,并使用 for each 循环来了解 Foreach - PowerShell | Microsoft Docs iterate the list in the variable and project the output to csv file using the export-csv .
Microsoft Docs迭代变量中的列表并使用export-csv将输出投影到 csv 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.