如何在PowerShell中运行Azure CLI Bash脚本?

问题描述 投票:0回答:1

我安装了Azure CLI.我可以在CMD或PowerShell上使用它,但我更喜欢PowerShell.文档中的教程命令是针对Azure CLI的。我可以在 CMD 或 PowerShell 上使用它,但我更喜欢 PowerShell.文档中存在的教程命令是针对 Azure CLI 与 Bash 的。我如何在PowerShell中运行这些命令?

例如,在PowerShell中

az group create \
  --name myResourceGroup \
  --location "Central US"

在PowerShell中无法运行,因为 \ 在PowerShell中不是一个延续字符,而且命令必须是单行。因此,我需要一个变通方法来在PowerShell中运行Bash脚本。

azure azure-powershell azure-cli
1个回答
0
投票

你可以在PowerShell中运行Azure CLI命令,比如。

az group create `
   --name myResourceGroup `
   --location "Central US" 

后勾(`)符号是PowerShell的续行字符,允许你在多行上继续执行一条命令。

© www.soinside.com 2019 - 2024. All rights reserved.