Avatar of wahlster
Flag 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,


Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.