Repository navigation
v2.1
ParallelKit 2.1
After updating, start a new PowerShell window: a session that already loaded 2.0 refuses to load 2.1 and tells you so.
Changes you might notice
- Programs start in your current location. Before, they ran in the PowerShell process's working folder, which
cdandSet-Locationnever change. So aftercd D:\workand.\script.ps1, programs started wherever the console had opened. A relativeWorkingDirectory, aFilePathlike.\tools\tool.exe, and paths on~or aNew-PSDrivedrive are now read the way PowerShell reads them. One case gets worse: a.bator.cmdprogram run while your current location is a network share (\\server\share) falls back toC:\Windows, so give those a localWorkingDirectory. (#22) - Each runspace job starts clean. Every job starts in your current location, in a fresh scope. A folder change or a variable from an earlier job,
$ErrorActionPreferenceincluded, no longer carries over to the next job on the same runspace. Inside a worker,$MyInvocationnow describes a scriptblock call. (#23) - Abort messages say what actually happened. Ctrl+Break and
Request-PkAbortare no longer announced as Ctrl+C, andGet-PkAbortTriggerLabelreturns"Ctrl+Break"or"Request-PkAbort"for them. Force-stop messages give the real reason instead of always "did not finish within 60s". (#20) CrashedCountalso counts workers that threw while an abort waited for them, and the result ofInvoke-PkRunspaceJobshas a newCrashedproperty. (#24)
Fixed
- Pressing Ctrl+C again now skips the wait. It used to be held back until the 60-second drain ended, and then it stopped the script, losing a batch's result. Now the second press stops running jobs straight away and your script carries on; a third press stops the script. (#20)
- Closing the window after Ctrl+C now runs
-JobAbortCleanupbefore Windows ends the process. (#20) - A
-ResultHandlerwritten without.GetNewClosure()that did$results.Add(...)no longer loops forever. (#19) - Output you drop in
-OnComplete($result.Stdout = $null) is now freed as the batch goes, instead of being held until it returns. (#25)
New
-JobCrashedHandler { param($err, $job) }gets the job that crashed. One-parameter handlers work as before, and a handler that throws is now reported instead of swallowed. (#24)- The README now covers crashes: what counts as a worker crash, how to return an error object from a worker, and why not to call
exitin one. (#24) - The test suite now sends real Ctrl+C, Ctrl+Break and window-close events, on every change, on 5.1 and 7. (#21)