问题描述
我真的是脚本新手(而且堆栈溢出)。我正在为离线网络编写脚本,以使用PSexec安装win10补丁。当我运行它时,wusa在执行过程中似乎正在PS控制台中运行,但实际上没有任何反应。检查完win10版本后,会发生两件事:首先,安装了最新的win10 SSU,然后安装了任何累积的/.net/adobe/其他文件(始终需要先安装SSU。)这就是我的意思。 / p>
$1903Updates = Get-ChildItem "$PSScriptRoot\1903\*" -include "*.msu"
if ([System.Environment]::OSVersion.Version.Build -eq 18362)
{
Write-Host "Windows 1903 patches installing."
Start-Process -FilePath "wusa.exe" -ArgumentList "$PSScriptRoot\1903\SSU\*.msu /quiet /norestart" -Wait -PassThru
foreach ($update in $1903Updates)
{
$update = $_.fullname
Start-Process -FilePath "wusa.exe" -ArgumentList "$update /quiet /norestart" -wait -Passthru
}
}
SSU位于1903 / SSU子文件夹中,所有其他.msu都位于1903主文件夹中。我为.msi / .exe安装程序写了类似的东西,效果很好,但是我不知道正确的语法来使wusa.exe正常工作。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)