Managing Jobs in Windows Powershell

Jobs are nothing logical tasks to be done. A job may create one or more processes.

Here is the list of Job commands in Windows Powershell.

  1. Start-Job
  2. Get-Job
  3. Receive-Job
  4. Remove-Job
  5. Wait-Job
  6. Stop-Job
  7. Resume-Job
  8. Suspend-Job
  9. Get-StorageJob
  10. Get-PrintJob
  11. Get-ScheduledJob
  12. Get-JobTrigger

Below image shows some of these commands in action.

job-commands-in-windows-powershell

job-commands-in-windows-powershell

Getting child jobs

When you start a job that runs on multiple computers, Powershell creates as many child jobs on each system.

To get the child jobs, you can use below command.

> Get-Job -id <Job-Number> | Select -ExpandProperty childjobs

Running a command as a Job

You can execute any command as a Job as shown in below example.

invoke-command -scriptblock {get-process} -computer localhost -asjob

You may also like...