recommended PowerShell script to install Azure CLI
hang inside Invoke-WebRequest
logs the installation details
,我看到安装失败,日志消息为“连接到服务器失败”。错误:0x80070005“。
0x80070005 means "Access Denied by DCOM"
. 我还读到
"server" is actually the Windows Installer service commanded by the msiexec client
是否可以在没有计算机管理员帮助的情况下升级Azure CLI?如何在这个方向上进一步调查?
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile AzureCLI.msi -UseBasicParsing
Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet /L*v! AzureCLI.log'
Get-Content AzureCLI.log
rm AzureCLI.msi, AzureCLI.log
日志是:
=== Verbose logging started: 3/12/2021 1:49:26 Build type: SHIP UNICODE 5.00.10011.00 Calling process: C:\windows\system32\msiexec.exe ===
MSI (c) (D4:F0) [01:49:26:301]: Resetting cached policy values
MSI (c) (D4:F0) [01:49:26:301]: Machine policy value 'Debug' is 0
MSI (c) (D4:F0) [01:49:26:301]: ******* RunEngine:
******* Product: AzureCLI.msi
******* Action:
******* CommandLine: **********
MSI (c) (D4:F0) [01:49:26:317]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (D4:F0) [01:49:26:317]: Grabbed execution mutex.
MSI (c) (D4:F0) [01:49:26:332]: Failed to connect to server. Error: 0x80070005
MSI (c) (D4:F0) [01:49:26:332]: Note: 1: 2774 2: 0x80070005
1: 2774 2: 0x80070005
MSI (c) (D4:F0) [01:49:26:332]: Failed to connect to server.
MSI (c) (D4:F0) [01:49:26:348]: MainEngineThread is returning 1601
=== Verbose logging stopped: 3/12/2021 1:49:26 ===
在过去,我能够使用上述推荐的PowerShell oneliner在多台这样的机器上从头开始安装azurecli。这台机器是一个azuredevops服务器代理,我可以编辑和运行使用它的Azure管道。我知道我最好问问管理人员,但他们在企业的一个单独的部门,他们是出了名的不可接近,不可靠,他们让每个人跳过愚蠢的无意义的箍。我们的Scrum团队发现,当我们自己处理技术上能做的一切,只要求他们做他们能做的事情时,效率通常是最高的。
az upgrade
,但它
calls
powershell.exe -NoProfile "Start-Process msiexec.exe -Wait -ArgumentList '/i https://aka.ms/installazurecliwindows'"
在引擎盖下,这不是无人看管的装置(
/quiet
丢失)。它保存了MSI下载时,当前版本已经安装,并处理其他操作系统上的其他包管理器,但我现在不需要任何这些。