Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Control Job Starts with PowerShell

$
0
0

Summary: Learn how to use Windows PowerShell to control which jobs start when.

Hey, Scripting Guy! Question How can I use Windows PowerShell to complete a group of jobs before I start more jobs?  

Hey, Scripting Guy! Answer Use the Start-Job cmdlet, for example, to start 3 long running processes:

Start-Job {<long running process 1>}

Start-Job {<long running process 2>}

Start-Job {<long running process 3>}

Then use Wait-Job to stop further processing. It works at the prompt, or even better, in a script:

Get-Job | Wait-Job

After your jobs have completed, you can run more jobs:

Start-Job {<long running process 4>}

Start-Job {<long running process 5>}


Viewing all articles
Browse latest Browse all 3333

Trending Articles