Skip to content

Fix Get-PfbSsotVersionMapUri hanging on missing mandatory params - #52

Merged
juemerson-at-purestorage merged 1 commit into
mainfrom
fix/ssot-version-map-uri-mandatory-prompt
Jul 25, 2026
Merged

Fix Get-PfbSsotVersionMapUri hanging on missing mandatory params#52
juemerson-at-purestorage merged 1 commit into
mainfrom
fix/ssot-version-map-uri-mandatory-prompt

Conversation

@juemerson-at-purestorage

Copy link
Copy Markdown
Collaborator

Summary

  • Get-PfbSsotVersionMapUri (in tools/lib/PfbVersionMapTools.ps1) declared
    -BaseUri/-TopicId as [Parameter(Mandatory)]. When run in a real
    interactive 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.
  • Replaces the two params with plain optional params plus explicit
    IsNullOrEmpty checks that throw a deterministic
    PSArgumentException in every host, interactive or not.
  • Found incidentally while live-testing an unrelated PR (Migrate cmdlets to centralized query-param handling #33's query-param
    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)
  • Confirmed no more interactive prompt when calling the cmdlet without
    a required param in a real console session
  • tools/Update-PfbVersionMap.ps1 (the only caller) always passes both
    params explicitly, so behavior for it is unaffected

🤖 Generated with Claude Code

…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
juemerson-at-purestorage merged commit 87b40e6 into main Jul 25, 2026
8 checks passed
@juemerson-at-purestorage
juemerson-at-purestorage deleted the fix/ssot-version-map-uri-mandatory-prompt branch July 25, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant