簡體   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