"Get-Job" Cmdlet in Windows PowerShell

Q

How to use "Get-Job" cmdlet in Windows PowerShell?

✍: FYIcenter.com

A

You can use the "Get-Job" cmdlet to display existing Windows PowerShell background job on the local computer.

Below is an example of "Get-Job" cmdlet displaying background jobs:

PS C:\fyicenter> start-job {get-process}
Id     Name            PSJobTypeName   State         HasMoreData     Command
--     ----            -------------   -----         -----------     -------
2      Job2            BackgroundJob   Running       True            get-process

PS C:\fyicenter> start-job {$now = get-date}
Id     Name            PSJobTypeName   State         HasMoreData     Command
--     ----            -------------   -----         -----------     -------
4      Job4            BackgroundJob   Running       True            $now = get-date

PS C:\fyicenter> get-job
Id     Name            PSJobTypeName   State         HasMoreData     Command
--     ----            -------------   -----         -----------     -------
2      Job2            BackgroundJob   Completed     True            get-process
4      Job4            BackgroundJob   Completed     False           $now = get-date

 

Managing Windows PowerShell Background Jobs

⇒⇒Windows PowerShell Tutorials

2016-10-08, 479👍, 0💬