【发布时间】:2018-12-20 02:06:16
【问题描述】:
我想添加一个任务序列,这意味着脚本将首先等待第一个任务完成,然后继续执行下一个任务。如果任务收到错误,它将不会继续,并且可能会为此创建日志。
WindowsSensor_F7C855810C3B47FC8931D2E5E9E889BF-57.exe /install /quiet /norestart
"%ProgramFiles%\CrowdStrike\CSInstallGuard.exe" PW="nzhHLfrpy5rqTFVsne8D"
if exist "%ProgramFiles%\Cylance\Desktop\CylanceSvc.exe" msiexec /x {2E64FC5C-9286-4A31-916B-0D8AE4B22954} /qn /norestart
下面是我出来的代码。有人可以清理一下吗
Start-Process "WindowsSensor_F7C855810C3B47FC8931D2E5E9E889BF-57.exe" /install /quiet /norestart | Out-null
Start-Process "%ProgramFiles%\CrowdStrike\CSInstallGuard.exe" PW="nzhHLfrpy5rqTFVsne8D" | Out-null
if (test-path %ProgramFiles%\Cylance\Desktop\CylanceSvc.exe .PathType leaf){
msiexec /x {2E64FC5C-9286-4A31-916B-0D8AE4B22954} /qn /norestart | Out-null
}
else {
break
}
【问题讨论】:
标签: powershell software-distribution sccm