首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在管道中使用AzureCLI任务时出错

在管道中使用AzureCLI任务时出错
EN

Stack Overflow用户
提问于 2020-02-28 10:16:21
回答 1查看 2.8K关注 0票数 0

我的Azure管道使用Azure 任务

代码语言:javascript
复制
- task: AzureCLI@2
    inputs:
      azureSubscription: '...'
      scriptType: pscore
      scriptLocation: 'inlineScript'
      inlineScript: |
        containers=$(az storage container list --connection-string '...')

如果出现此错误,任务将失败:

代码语言:javascript
复制
The term 'containers=$(az storage container list --connection-string '...')' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\_temp\azureclitaskscript1582829158619_inlinescript.ps1:1 char:1
+ containers=$(az storage container list --connection-string 'DefaultEn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (containers=$(az sto\u2026ame}" --output tsv):String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException

##[error]Script failed with error: Error: The process 'C:\Program Files\PowerShell\6\pwsh.exe' failed with exit code 1
C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" account clear"
Finishing: AzureCLI

我不知道为什么会发生这种事。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-28 11:00:03

在这种情况下,问题是由于语法错误:

代码语言:javascript
复制
$containers=$(az storage container list --connection-string '...')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60449605

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档