Azure CLI:无法在 Windows PowerShell 中转义管道字符 (|)

Azure CLI: Unable to escape pipe character (|) in Windows PowerShell

场景

我尝试在我的 windows 机器上使用 Azure CLI 创建一个 Azure Web 应用程序。不幸的是,我无法为我的 webapp 选择运行时。当我尝试:az webapp create -n name -g grop -p plan -r "DOTNETCORE|3.1" 时,出现错误:

'3.1' is not recognized as an internal or external command,

可运行的程序或批处理文件。

我试图用反斜杠转义管道 \ 但它没有帮助

您需要用引号引起来,试试这个

az webapp create --name somename -g grop  --plan plan  --runtime='"DOTNETCORE|3.1"'

同时将管道 | 替换为冒号 : 有助于:

az webapp create --name somename -g grop  --plan plan  --runtime="DOTNETCORE:3.1"