我正在尝试编写一个PowerShell脚本来安装windows机器。我想使用winget,但我认为使用命令行安装winget并不是一种简单的方法。您必须使用windows商店或从github下载msxibundle。
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle这两种方法都需要用户的交互,而不仅仅是运行脚本和走开。有更好的办法吗?谢谢。
发布于 2022-10-22 18:54:25
使用Windows PowerShell而不是PowerShell Core,有一个命令可以帮助:Add-AppXPackage
Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle应该允许您安装软件包。
希望这能有所帮助
https://stackoverflow.com/questions/74166150
复制相似问题