Releases: Klark-Morrigan/Common-PowerShell
Releases · Klark-Morrigan/Common-PowerShell
Release list
9.3.0
Added
Export-PhaseTimingTreeIfRequested- the self-guarding opt-in wrapper over
Export-PhaseTimingTree. Reads the output-path environment variable (default
TIMING_TREE_OUTPUT_PATH, overridable via-EnvVariableName) and delegates
toExport-PhaseTimingTreeonly when it is set; unset/empty, or a
never-initialised default context, is a no-op. Centralises the env-var guard
every child emitter (provision.ps1,create-users.ps1,remove-users.ps1,
register-runners.ps1) previously hand-wrote at each export site, so the
opt-in contract name lives in exactly one place - a typo can no longer
silently disable a single consumer's export - and each call site collapses to
one intention-revealing call. The coreExport-TimingSpanTreeand its shim
Export-PhaseTimingTreestay mandatory on their path argument; the env-var
read lives only in this opt-in-aware layer.
9.2.0
Added
Export-PhaseTimingTree- the export counterpart of the 2-level
Write-PhaseTimingReportcompat shim. Serialises the module-private default
context ($script:DefaultPhaseTimingTree, the tree the phase/sub-step shims
build) to the versioned nested-JSON schema (e2e-timing/v1) by delegating to
the context-explicit coreExport-TimingSpanTree. Same no--Treesurface and
same "return silently when the context was never initialised" null-guard as
Write-PhaseTimingReport, so it is safe to call from the same outer finally.
Gives a shim consumer (provision.ps1,register-runners.ps1) the missing
handle to serialise its timings for the cross-process handoff, on the
TIMING_TREE_OUTPUT_PATHopt-in, without exposing the default context or
overloading the core verb with a hidden-global fallback.
9.1.0
Added
- Timing-tree framework (
New-TimingSpanTree,Initialize-TimingSpanTree,
Measure-TimingSpan,Add-TimingSpanDuration) - an arbitrary-depth,
context-owned nested span model with by-name accumulation and sticky-Failed
status. Generalises the provisioner's 2-level phase-timing framework so
timings can nest to any depth and, later in the feature, cross the process
boundary. Export-TimingSpanTree/Import-TimingSpanTree- the cross-process
handoff for the timing tree. Export serialises a context's whole tree to
the versioned nested-JSON schema (e2e-timing/v1; explicitchildren[],
first-classstatus, invariant-culture numbers); Import rebuilds it into
an in-memory subtree, tolerating a missing or malformed file (returns
$nullwith a warning, never throws) so a crashed child never fails the
parent's own report.Write-TimingSpanReport- renders a timing context or a bare node subtree
as a depth-indented, single-colour (DarkGreen) console block: per span a
fixed-width[OK]/[FAILED]/[SKIPPED]/[RUNNING]tag, invariant-culture
F2seconds, and percent of its parent's effective elapsed, closed by a
total observedline for the root. The arbitrary-depth, merge-aware
counterpart of the provisioner's 2-levelWrite-PhaseTimingReport; a
SKIPPEDnode shows a dash and no percent, and the total counts the root's
effective elapsed (top-level spans, no sub-step double-count).- 2-level phase-timing compat shims (
Initialize-PhaseTimings,
Invoke-WithPhaseTimer,Invoke-WithSubStepTimer,Add-SubStepDuration,
Write-PhaseTimingReport) - the provisioner's pre-generalisation timing
surface, re-expressed as thin wrappers over the timing-tree core and a
single module-scoped default context so existing call sites keep their exact
signatures (no-Treeargument). Behaviour-preserving: the verbs throw on
the same undeclared-phase / not-initialised conditions and
Write-PhaseTimingReportemits the byte-identical legacy report (fixed
banner, no percent column, top-level-only total). Lets a consumer migrate to
one framework without rewriting call sites.
9.0.1
Fixed
Invoke-ModuleInstallnow imports the target module with-Global. Because
the function is itself a module export, a plainImport-Moduleplaced the
installed module's commands in this module's session state rather than the
caller's, so callers silently relied on command auto-loading. When two
installed modules export the same command (e.g. a renamed/split module
leaves an old copy behind), auto-load resolved to the alphabetically-first
one - which could be the stale version.-Globalmakes the explicit import
authoritative in the caller's scope, so resolution is deterministic.
9.0.0
Changed
- Major version bump; no functional changes (version realignment).
8.1.0
Added
Invoke-WithExitCodeRetry- exit-code counterpart toInvoke-WithRetry
for native commands (netsh,git,docker,wsl, ...) that signal
failure through$LASTEXITCODEinstead of a thrown exception. Reuses the
existing backoff strategies; scope retries with an optional
-RetryableExitCodeset, or throw and useInvoke-WithRetryfor
predicate-based classification.