Skip to content

powershell - wait for process to finish

Featured Replies

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

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

  • Author

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.