Link to home
Start Free TrialLog in
Avatar of wahlster
wahlsterFlag for United States of America

asked on

Invoke .exe as Foreground Process

Hi, I am very new to Powershell.  I am trying to execute a backkup application in a try/catch block as a foreground process.  When I run the following commands in Powershell it appears to spawn the process as a background process and continues to next line of the script without waiting for the exe to complete.  I need the script to wait for the exe to complete.  Here is a snippit of the script:

    - Backup C: drive to H:\Backup
    $exe = 'C:\Program Files (x86)\Snapshot\snapshot.exe'
    & $exe C: H:\Backup

Thanks in advance for your help,
Terry

ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial