繁体   English   中英

在 Azure DevOps 管道中运行 Azure powershell 命令

[英]Run Azure powershell commands in Azure devops pipeline

在此处输入图片说明 我应该怎么做才能针对发布管道运行 Azure powershell 命令。 当我尝试在“内联 Azure Powershell”中运行 Azure powershell 命令时,出现以下错误。

##[error]The term 'Get-AzKeyVaultSecret' 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.

我正在使用 Azure 管道提供的托管代理

有2种方法。

建议您使用Azure Powershell Task并更改为Inline类型。

第一种方法是将Azure Powershell 任务版本更改为4.* 4.* ,我们内置Az.KeyVault模块。 并且会下载对应的dll来支持这个命令的使用。

在此处输入图片说明


或者您可以继续使用1.*版本任务。 赶紧跑

Install-Module Az.KeyVault

命令首先准备环境。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM