0

PowerShell script has the following

Start-Process "D:\Script\EMAIL_Snapshot_Done.bat" $date, $scr_comp
Start-Process "D:\Script\BATCH_gup.bat"

How to ensure that first Start-Process starts and finishes BEFORE second Start-Process begins?

Glowie
  • 2,271
  • 21
  • 60
  • 104

1 Answers1

2

Something simple like this should do the trick.

Start-Process "D:\Script\EMAIL_Snapshot_Done.bat" $date, $scr_comp -Wait

You would have found this information on TechNet

Wait-Process could also help but the simplicity of -Wait should not compare.

Matt
  • 45,022
  • 8
  • 78
  • 119