how to prevent powershell scripts that spawn an executable, finish prematurely

7 views
Skip to first unread message

Andy Burrows

unread,
Feb 6, 2020, 2:06:14 PM2/6/20
to Packer
does anyone have a foolproof way of waiting for a spawned background (installation) executable , to finish when spawned from powershell provisioner.
I have tried ..

```powershell
$proc = Start-Process -FilePath "D:\CaptureSV\WrkInst\Setup.exe" -ArgumentList "/s","/i:D:\Kofax\CaptureInitialization.ini" -NoNewWindow -PassThru
            $proc.WaitForExit()
```
but still the powershell provisioners don't wait and march on with the next ps script which are dependant on the first shell script finishing !
Thanks,
Andy
Reply all
Reply to author
Forward
0 new messages