Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,11 +806,13 @@ Additions, changes, fixes, and other things that have been evaluated and decline
- **Writing output past the `-MaxOutputChars` cap to a file.** The kit can't know where you'd want those files or when they're safe to delete. If you need all of a program's output, redirect it in the command (`cmd /c tool.exe > out.txt 2>&1`) or use the program's own output option.
- **More fields on results, such as `Index`, `Status`, `JobId` or batch totals.** Any key you put on a command comes back on its result's `Command`, so `Index = $n` lets you sort on it: `$batch.Results | Sort-Object { $_.Command.Index }`. A `Status` field would only repeat `ExitCode`, `StartError`, `TimedOut` and `Aborted`, and what counts as failure is up to you: some programs exit nonzero on success.
- **Aliases for result fields.** An alias would show up as a second column in `Format-Table`, `Export-Csv` and JSON.
- **Fewer reserved names on job hashtables.** The dispatcher keeps its state on each job under the names listed in [Process dispatch with groups](#process-dispatch-with-groups). Moving seven of them under one key would cut the list from thirteen to seven, but the dispatcher reads them for every job, and a nested lookup costs time per job on Windows PowerShell 5.1. They're unlikely names for fields of your own; if one clashes, rename your field.
- **Built-in structured logging (JSON Lines, lifecycle events).** `Set-PkMessageHandler` receives every message the kit writes, with its level, `-OnComplete` and `-ResultHandler` see each result, and `-JobFinalize` each finished job, so you can write whatever format you need from there. An event for every job, built in, would slow the engines on Windows PowerShell 5.1.
- **Signing the release.** That needs a paid code-signing certificate. If your machines require signed scripts (`AllSigned`), sign the file with a certificate they trust, as [Setup](#setup) says.
- **Separate checksums or build provenance.** The release asset is `ParallelKit.ps1` itself, attached straight from the tagged source with no build step, and GitHub shows a SHA-256 digest for it on the release page. Compare it with `Get-FileHash .\ParallelKit.ps1`. The module does have a build step, but the same `.ps1` always gives the same module, so you can build it and compare.
- **Avoiding the private part of .NET the kit uses.** To create a program inside the Job Object, the kit briefly makes its output pipes inheritable, and holds .NET's own process-start lock meanwhile so that no other program PowerShell or .NET starts at that moment picks them up. That lock isn't public. If a future .NET moves it, the kit doesn't fail: it starts programs the older way, warns once, and `Initialize-ParallelKit` reports `StartMode` `AddedToJob` (see [Process-tree cleanup limitations](#process-tree-cleanup-limitations)). Doing without the lock would mean always using that older way, or risking output held open by an unrelated program.
- **Fractional abort timeouts.** `-AbortTimeoutSeconds` is whole seconds; 2.5 is rounded to a whole number. `-TimeoutSeconds`, the time limit on a program, does take fractions.
- **Telling a worker's own functions apart in the `UndeclaredVariable` check.** A variable counts as declared if the worker declares or assigns it anywhere, so in `param($Id) function Add-One { param($n) $n + 1 }; $n + $Id` the `$n` outside the function isn't flagged, though it's empty there. Telling the scopes apart would mean following dot-sourced functions, whose variables do reach the caller, and functions that read their caller's variables, and a wrong guess would refuse a worker that works. Missing a variable that reads as empty is the lesser problem.

</details>

Expand Down