Jump to content




Polarman

powershell - wait for process to finish



Recommended Posts

I have a script installing "LabView" from "National Instruments".

However the installer (setup.exe with parameters) is just starting a lot of other installers, and when I use SCCM and detection method the software goes to "installed" just after starting install, although it continues for another hour (!).

That is because im checking if a file is present.

 

How could I instead check for "when a process finish or exits then the software is installed"?

 

Knut

Share this post


Link to post
Share on other sites


try | Out-Null like so

write-host "about to install SQL Server 2016 SSMS..." -nonewline
$Parms = " /Install /Quiet /Norestart /Logs log.txt"
$Prms = $Parms.Split(" ")
& "$filepath" $Prms | Out-Null
Write-Host "done!" -ForegroundColor Green

it won't release the process until it's complete

Share this post


Link to post
Share on other sites

try | Out-Null like so


& "$filepath" $Prms | Out-Null


it won't release the process until it's complete

Can I change this to "start-process "$filepath" -argumentlist "$arguments" | Out-Null ?

Or is the "&" only set for this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×