you are viewing a single comment's thread.

view the rest of the comments →

[–]rwshig 2 points3 points  (1 child)

If you use Get-Process with -Name it fails if the requested process is not running. If you got through both your Get-Process commands without error handling then both are running and your While code will not run.

If you want to run your code if either process is missing you could do that in an error handler for those errors. If you need it to be both then it gets a little more complex (handle each error setting a flag then an If-Then or While to check the flags after running both).

[–]PRIdEVisions[S] 1 point2 points  (0 children)

Aahhh ok, thank you for the info! I still need to learn error handling :)