From d1ca1e4f23965cdd2a1fb2b4409c3a789a1bd8df Mon Sep 17 00:00:00 2001 From: Hal <22532613+HalRiveria@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:17:51 -0500 Subject: [PATCH] Version 3.2 Header says Version 3.2, and the README says it describes 3.2 and later. Also gives the swallow-all catch around BeginStop in the abort drain its reason comment, as its twin in the runspace teardown has. Co-Authored-By: Claude Opus 5.5 --- ParallelKit.ps1 | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ParallelKit.ps1 b/ParallelKit.ps1 index 4839f14..5e37efc 100644 --- a/ParallelKit.ps1 +++ b/ParallelKit.ps1 @@ -2,7 +2,7 @@ # graceful Ctrl+C/window-close handling for Windows PowerShell 5.1 and # PowerShell 7. # -# Version 3.1 - https://github.com/HalRiveria/PowerShell-ParallelKit +# Version 3.2 - https://github.com/HalRiveria/PowerShell-ParallelKit # Copyright (c) 2026 HalRiveria. MIT License: keep this notice with any copy; # the full text is in LICENSE in the repository. # @@ -2688,7 +2688,7 @@ function Invoke-PkGracefulDrain { foreach ($h in $localHandles) { # BeginStop, not Stop: Stop() blocks until the pipeline # actually unwinds, and a worker stuck in a .NET call never does. - try { $null = $h.PS.BeginStop($null, $null) } catch { } + try { $null = $h.PS.BeginStop($null, $null) } catch { } # one worker that can't be asked to stop mustn't keep the rest from being asked } } diff --git a/README.md b/README.md index 9af84c8..b77089b 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ What none of them do for you: ## Setup -Requires Windows, with Windows PowerShell 5.1 or PowerShell 7. Download `ParallelKit.ps1` from the [Releases page](https://github.com/HalRiveria/PowerShell-ParallelKit/releases) (this README describes version 3.1 and later), put it in your project, and dot-source it from your script: +Requires Windows, with Windows PowerShell 5.1 or PowerShell 7. Download `ParallelKit.ps1` from the [Releases page](https://github.com/HalRiveria/PowerShell-ParallelKit/releases) (this README describes version 3.2 and later), put it in your project, and dot-source it from your script: ```powershell . "$PSScriptRoot\ParallelKit.ps1"