简体   繁体   English

PowerShell 远程处理未安装 MSI

[英]PowerShell Remoting Not installing MSI

Good Afternoon, I'm having some troubles getting the Microsoft Edge.msi to install onto a windows server 2012R2 through PowerShell Remoting.下午好,我在通过 PowerShell Remoting 将 Microsoft Edge.msi 安装到 windows 服务器 2012R2 上时遇到了一些麻烦。 The code works on my local machine but when I try to parse it through with remoting it just hangs there and nothing happens.该代码在我的本地机器上运行,但是当我尝试通过远程解析它时它只是挂在那里并且没有任何反应。 I've waited up to an hour in trying to troubleshoot this, so just looking for some help.我已经等了一个小时试图解决这个问题,所以只是寻求一些帮助。 \ \

The.msi file is located locally on the server. .msi 文件位于服务器本地。 I do know that the PS Remoting connects to the server as I can pass commands to make folders as an example.我确实知道 PS Remoting 连接到服务器,因为我可以传递命令来制作文件夹作为示例。

Invoke-Command $Server -Scriptblock {
    Write-Host "Installing Microsoft Edge"
    Start-Process C:\Source\BuildSource\Laptop\21-MicrosoftEdge\MicrosoftEdgeEnterpriseX64.msi /quiet -wait
    Write-Host "Microsoft Edge Installed"
}

Further to my comment I've just tested out the below method:除了我的评论,我刚刚测试了以下方法:

$installArgs = @(
    "/i"
    "C:\temp\MSEdge\MicrosoftEdgeEnterpriseX64.msi"
    "/qb!"
    )

Invoke-Command $Server -Scriptblock {
    write-Host "installing Microsoft Edge" 
    Start-Process "msiexec.exe" -ArgumentList  $installArgs -Wait
    Write-Host "Microsoft Edge installed" 
    }

I'd recommend adding some logging too.我建议也添加一些日志记录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM