Fix Get-PfbSsotVersionMapUri hanging on missing mandatory params - #52
Merged
juemerson-at-purestorage merged 1 commit intoJul 25, 2026
Merged
Conversation
…onMapUri [Parameter(Mandatory)] on -BaseUri/-TopicId caused PowerShell's binder to prompt interactively for the missing value when run in a real interactive host, instead of throwing -- hanging a real terminal session rather than failing fast. Tests/PfbVersionMapTools.Tests.ps1's "requires -X" assertions only passed reliably in non-interactive hosts (CI) by accident. Replace with optional params + explicit IsNullOrEmpty checks that always throw deterministically regardless of host interactivity. Existing tests pass unchanged. Unrelated to #33's query-param migration but found while live-testing that work locally in an interactive terminal.
juemerson-at-purestorage
deleted the
fix/ssot-version-map-uri-mandatory-prompt
branch
July 25, 2026 00:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Get-PfbSsotVersionMapUri(intools/lib/PfbVersionMapTools.ps1) declared-BaseUri/-TopicIdas[Parameter(Mandatory)]. When run in a realinteractive PowerShell host, a missing mandatory parameter doesn't throw —
it prompts interactively for the value instead, which hangs the terminal
rather than failing fast. Non-interactive hosts (most CI runners) throw
immediately, so this was invisible until run by hand.
IsNullOrEmptychecks that throw a deterministicPSArgumentExceptionin every host, interactive or not.migration) locally — not connected to that work otherwise.
Test plan
Tests/PfbVersionMapTools.Tests.ps1's existing "requires -BaseUri" /"requires -TopicId" assertions still pass unchanged (10/10)
a required param in a real console session
tools/Update-PfbVersionMap.ps1(the only caller) always passes bothparams explicitly, so behavior for it is unaffected
🤖 Generated with Claude Code