Thursday, August 31, 2006

Unix Style Background Jobs in Powershell

Ripping from the original source...
PS> new-job { get-date; start-sleep 5; get-date }
Job 0 Started
#
PS>
Job 0 Completed
PS> jobs 0
JobId Status Command Results
----- ------ ------- -------
5 Completed get-date; start-sleep 5; ... 8/30/2006 4:47:32 PM
PS> (jobs 0).results
Wednesday, August 30, 2006 4:47:32 PM
Wednesday, August 30, 2006 4:47:37 PM
Looks very cool to me. Now to find some uses for this! :)

No comments: