如何使用 AzureCLI 执行 powershell 脚本?

How to execute powershell script using AzureCLI?

我正在尝试执行 powershell 脚本以在 Azure 基础结构上创建资源。我已经在我的机器上安装了 Azure CLI,并按照所有步骤使用 az login 命令登录。我还使用 az account set --subscription "My Demos" 命令设置了我的订阅。

现在我想使用此设置执行 powershell 脚本。

谁能帮我解决这个问题?

请在 azure cli 中 运行 时在 powershell 脚本前添加单词 powershell

如下所示:

powershell Get-AzVM -ResourceGroupName "xxx" -Name "xxx" -Status