从网络文件夹静默安装 msi 和 exe

问题描述

我正在尝试使用一个脚本来以静模式安装 exe 和 msi 文件,但它会打开安装程序而不是静运行。

#network drive path
$nwDrivePath = "\\server\folder\"                                                  #"

#check if path is valid
if (test-path $nwDrivePath){
    Set-Location $nwDrivePath
}
else{
    #if path is not valid abort
    Write-Output "No path found for $nwDrivePath"
    Write-Output "Aborting script"
    break script
}

#install .exe files
    $allFiles = Get-ChildItem $nwDrivePath -Filter *.exe | ForEach {
    start-process $_.Fullname -ArgumentList "/s"
    }

#install .msi files
    $allFiles = Get-ChildItem $nwDrivePath -Filter *.msi | ForEach {
    start-process $_.Fullname -ArgumentList "/qn"
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)