Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
找不到模块:';Az.账户';-在VM规模上设置Azure Windows数据中心2019_Azure_Powershell_Azure Devops_Command Line Interface - Fatal编程技术网

找不到模块:';Az.账户';-在VM规模上设置Azure Windows数据中心2019

找不到模块:';Az.账户';-在VM规模上设置Azure Windows数据中心2019,azure,powershell,azure-devops,command-line-interface,Azure,Powershell,Azure Devops,Command Line Interface,我们在Azure DevOps中有一个Azure Powershell任务正在尝试运行和安装: Install-Module -Name Az.Accounts -RequiredVersion 1.6.2 -Force Install-Module -Name "AzureAD" -Force 对于DevOps代理池,我在OSWindows2019数据中心上有两个虚拟机的Azure Scaleset 运行DevOps管道时,出现以下错误: ##[error]Initial

我们在Azure DevOps中有一个Azure Powershell任务正在尝试运行和安装:

Install-Module -Name Az.Accounts -RequiredVersion 1.6.2 -Force
Install-Module -Name "AzureAD" -Force
对于DevOps代理池,我在OS
Windows2019数据中心上有两个虚拟机的
Azure Scaleset
运行DevOps管道时,出现以下错误:

##[error]Initializing Az module failed: For troubleshooting, refer: https://aka.ms/azurepowershelltroubleshooting
##[error]Could not find the modules: 'Az.Accounts' with Version: ''. If the module was recently installed, retry after restarting the Azure Pipelines task agent
DevOps任务已配置为Azure Powershell task v.4+最新版本。 在带有windows-2019的defaul Azure DevOps代理上运行时,该脚本可以工作。 你知道我在这里遗漏了什么吗


您可以尝试运行
Get Module-listavable
以列出所有模块。az.accounts/azurern尚未安装在您的VMS池中。但是windows2019代理已经安装了这些模块,因此可以正常工作。然后我得到了错误:术语“pwsh.exe”未被识别为cmdlet、函数、脚本文件或可操作程序的名称。此问题是您启用了powershell core选项,但代理上尚未安装powershell core