使用 powershell 无需手动干预即可安装任何 exe

Installing any exe without having manual intervention using powershell

我如何在没有任何用户操作的情况下安装任何“.exe”,这意味着只要用户交互需要,它就应该使用 powershell 继续使用默认选择(例如:许可协议)

任何参考或链接都会有所帮助

[下面讨论:主要是想安装 visual studio 和 visual studio 相关更新]

如果您谈论的是 Visual studio 和一般的 Microsoft 产品,您应该寻找无人值守安装,例如:How to: Create and Run an Unattended Installation of Visual Studio.

对于 Visual Studio 以下命令有效:

 Start-Process -FilePath "C:\Installs\VS2013\vspremium.exe" -ArgumentList "/adminfile C:\Installs\VS2013\AdminDeployment.xml /passive /norestart" -Wait -NoNewWindow -PassThru

您还可以在 AdminDeployment.xml 文件中设置 NoWeb="yes",否则它也可以工作。

<BundleCustomizations TargetDir="default" NoWeb="yes"/>