troubleshooting Question

Invoke .exe as Foreground Process

Avatar of wahlster
wahlsterFlag for United States of America asked on
1 Comment1 Solution709 ViewsLast Modified:
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,

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros