Collections:
Other Resources:
"Stop-Job" Cmdlet in Windows PowerShell
How to use "Stop-Job" cmdlet in Windows PowerShell?
✍: FYIcenter.com
You can use the "Stop-Job" cmdlet to stop (terminate) the execution of an existing background job
by using the "-id n" or "-name xxx" to specify the background job.
The output result of the stopped background job will stay in memory.
Here is an example of using the "Stop-Job" cmdlet:
PS C:\fyicenter> start-job {for($i=0; $i -lt 100; $i++) {write-host "$i sec"; sleep 1} }
Id Name PSJobTypeName State Command
-- ---- ------------- ----- -------
14 Job14 BackgroundJob Running for($i=0; $i -lt 100...
PS C:\fyicenter> stop-job 14
PS C:\fyicenter> get-job
Id Name PSJobTypeName State Command
-- ---- ------------- ----- -------
2 Job2 BackgroundJob Completed get-process
4 Job4 BackgroundJob Completed $now = get-date
14 Job14 BackgroundJob Stopped for($i=0; $i -lt 100...
PS C:\fyicenter> receive-job 14 -keep
0 sec
1 sec
2 sec
3 sec
4 sec
5 sec
...
⇒ "Remove-Job" Cmdlet in Windows PowerShell
⇐ "Receive-Job" Cmdlet in Windows PowerShell
2016-10-08, ∼3210🔥, 0💬
Popular Posts:
What is the scheduled task "\OneDrive Standalone Update Task-S-1-..." on my Windows 7 computer? "\On...
How to remove jusched.exe from startup program list? jusched.exe is a background process from Sun to...
What is the startup program "Alps Pointing Device Driver - Apoint.exe" on my Windows 8 computer? Can...
What is the startup program "Alps Pointing Device Driver - Apoint.exe" on my Windows 8 computer? Can...
What is AcroIEHelper.dll - DLL file - Adobe Acrobat IE Helper Version 6.0 for ActiveX? DLL AcroIEHel...