I am trying to install a package using a PS script through SCCM. The application installs fine but during the installation, the application is launched. The SCCM job will not complete until the application is closed. I want to be able to add some code to my script to shut the application down after installing, so SCCM will show success.
Currently I just have:
start-process -FilePath ‘xxxxx.exe’ -wait
if (get-process ‘xxxx.exe’){
stop-process ‘xxxx.exe’
}
I think if you reference the actual name of the process with Get-Process and Stop-Process, rather than “name.exe”, it should work a bit better for you. Hope that helps!