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.
  • Start-Job
  • Get-Job
  • Receive-Job
  • Remove-Job
  • Wait-Job
  • Stop-Job
  • Resume-Job
  • Suspend-Job
  • Get-StorageJob
  • Get-PrintJob
  • Get-ScheduledJob
  • Get-JobTrigger
Below image shows some of these commands in action.

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

Web development and Automation testing

solutions delivered!!