azure - 如何使用AzureCLI执行powershell脚本?

标签 azure powershell azure-cli2

我正在尝试执行 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

enter image description here

关于azure - 如何使用AzureCLI执行powershell脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54928488/

相关文章:

azure - 如何让Azure云启动环境变量持续存在

powershell - 具有参数的简单Powershell Msbuild失败

Azure CLI。是否可以更新/设置网络应用程序的默认文档?

powershell - 如何让 "pwsh -c {...}"在Ubuntu上通过powershell命令的表达式结果?

javascript - 如何使用 Windows 脚本设置手刹默认预设

docker - 无法在 MacOS 上运行 az acr check-health 命令

php - 让Azure Web应用程序显示php错误

Azure应用程序网关多次提示输入凭据(我的应用程序使用Windows Auth)

visual-studio-2012 - TFS 2013 Web 访问“部署”选项卡