Skip to content

Sync to v2.1.2 (API-drift cleanup) - #4

Merged
dmann000 merged 10 commits into
mainfrom
sync/2.1.2
Jul 20, 2026
Merged

Sync to v2.1.2 (API-drift cleanup)#4
dmann000 merged 10 commits into
mainfrom
sync/2.1.2

Conversation

@dmann000

Copy link
Copy Markdown
Collaborator

Brings the fork to v2.1.2, matching upstream dmann000/fb-powershell main.

  • Removes 3 never-functional cmdlets (Remove-PfbSession, New-/Remove-PfbNetworkAccessPolicy) that always returned HTTP 405 (rules remain via New-/Remove-PfbNetworkAccessRule).
  • ValidateSet/enum fixes: Get-PfbArrayPerformance -Protocol (+all), New-PfbAlertWatcher -MinimumSeverity (-error), Get-PfbArraySpace -Type; New-PfbQuotaUser test-hang fix.

Validated: Test-ModuleManifest OK (523 exports), Pester 154/0/2 on the cross-platform CI.

🤖 Generated with Claude Code

juemerson-at-purestorage and others added 10 commits July 16, 2026 09:50
The "throws when neither -UserName nor -UserId is supplied" test invoked the
cmdlet with neither identity parameter. Since -UserName is Mandatory in the
default ('ByName') parameter set, PowerShell's own parameter binder can't
resolve which set applies, falls back to the default, and then prompts
interactively for the missing -UserName instead of letting the cmdlet's own
code run -- hanging forever with no TTY to answer it (reproduced in both a
real interactive terminal and this suite's own non-interactive runner).

Replaced the invocation with a metadata check confirming -UserName and
-UserId are each Mandatory in their own parameter sets, which proves the same
"neither supplied" case is rejected without ever risking the hang.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…rror'

The FlashBlade API only accepts info/warning/critical for
minimum_notification_severity -- confirmed against the OpenAPI spec and
live against FB-A (the array rejects 'error' with "Invalid minimum
notification severity specified (choose from 'info', 'warning',
'critical')"). The sibling Update-PfbAlertWatcher cmdlet already had the
correct 3-value set; New-PfbAlertWatcher's ValidateSet and help text are
now consistent with it and with the real API.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The server-side arrays/space endpoint silently returns an empty space
object for any unrecognized -Type value instead of erroring (verified
live on FB-A: -Type all and -Type garbage-value both returned an empty
result with no error). Add a client-side [ValidateSet(''array'',
''file-system'', ''object-store'')] so invalid values fail fast with a
clear error before any HTTP call is made, and tighten the .PARAMETER
Type help text to state the exact valid values and default.

Adds Tests/Get-PfbArraySpace.Tests.ps1 (no prior test coverage existed
for this cmdlet) covering the ValidateSet attribute, rejection of an
invalid value with zero API calls, pass-through of a valid value, and
omission of -Type from the query string when unspecified.

Live-verified against FB-A (10.21.243.66): -Type array/file-system/
object-store still return real, distinct data; -Type all and -Type
garbage-value now throw immediately client-side with no HTTP call.
The FlashBlade REST API's `protocol` query parameter for
`GET arrays/performance` (confirmed stable across fb2.0-fb2.27
OpenAPI specs) documents valid values as `all`, `HTTP`, `SMB`, `NFS`,
and `S3`, defaulting to `all` (combined performance of all protocols)
when omitted. The existing ValidateSet('nfs', 'smb', 'http', 's3')
was missing 'all', so a user explicitly passing -Protocol all was
rejected client-side by PowerShell's own parameter binder before any
API call, even though it is the exact behavior of omitting -Protocol
entirely.

- Add 'all' to the ValidateSet and update the .PARAMETER Protocol
  comment-help to document it as the default.
- Add Tests/Get-PfbArrayPerformance.Tests.ps1 covering: ValidateSet
  membership, the -Protocol all regression, -Protocol nfs unchanged,
  rejection of an invalid value with zero API calls, and omitting
  -Protocol entirely.

Live-verified against FB-A (10.21.243.66): all, nfs, smb, http, and
s3 all now return data; an invalid value is still rejected
client-side with zero API calls.
…auser-test-hang-prompt

Fix New-PfbQuotaUser test hang on missing mandatory -UserName
…twatcher-minimumseverity-validateset

Fix New-PfbAlertWatcher -MinimumSeverity ValidateSet: drop invalid 'error'
…pfbarrayspace-type-validateset

Add ValidateSet to Get-PfbArraySpace -Type
…pfbarrayperformance-protocol-validateset

Fix incomplete ValidateSet on Get-PfbArrayPerformance -Protocol
Removes Remove-PfbSession, New-PfbNetworkAccessPolicy, Remove-PfbNetworkAccessPolicy
- they modeled REST endpoints that never existed in any FlashBlade API version
(2.0-2.27) and always returned HTTP 405. Sessions are read-only; network-access
policies are a fixed built-in set (only their rules are mutable, already covered by
New-/Remove-PfbNetworkAccessRule). Nothing that worked stops working.

ModuleVersion 2.1.1 -> 2.1.2; manifest FunctionsToExport 526 -> 523; CHANGELOG +
ReleaseNotes updated. The ValidateSet/enum fixes (PRs dmann000#13-16) are already on main
and are folded into this 2.1.2 release note. Validated: Test-ModuleManifest OK (523
exports), Pester 154 passed / 0 failed / 2 skipped (pwsh 7, 24 suites).
v2.1.2: remove 3 never-functional cmdlets (API-drift cleanup)
@dmann000
dmann000 merged commit 2b95200 into main Jul 20, 2026
8 checks passed
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.

2 participants