Add demote support to Update-PfbFileSystem (-DiscardNonSnapshottedData, -RequestedPromotionState) - #1
Merged
dmann000 merged 1 commit intoJul 2, 2026
Conversation
- -DiscardNonSnapshottedData switch -> discard_non_snapshotted_data=true query param - typed -RequestedPromotionState (promoted|demoted), mutually exclusive with -Attributes - Pester coverage (6 tests) + v2.0.5 release notes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
juemerson-at-purestorage
added a commit
that referenced
this pull request
Jul 6, 2026
Fix #1 (-HttpTimeout is a no-op), Fix #2 (TLS 1.2 wrongly coupled to -IgnoreCertificateError), Fix #4 (Connect-PfbArray not reusing ConvertTo-PfbApiError) -- three issues found while auditing this code earlier, bundled into this branch since they touch the same file. Fix #3 (OAuth2 auto-reconnect) already became the sibling feature/connect-pfbarray-oauth2-token-refresh branch. Scoped to explicitly avoid the Certificate/OAuth2 branch of Connect-PfbArray.ps1, which the sibling branch is about to rewrite -- touching it here would create a guaranteed merge conflict.
juemerson-at-purestorage
added a commit
that referenced
this pull request
Jul 6, 2026
Fix #1 (-HttpTimeout is a no-op), Fix #2 (TLS 1.2 wrongly coupled to -IgnoreCertificateError), Fix #4 (Connect-PfbArray not reusing ConvertTo-PfbApiError) -- three issues found while auditing this code earlier, bundled into this branch since they touch the same file. Fix #3 (OAuth2 auto-reconnect) already became the sibling feature/connect-pfbarray-oauth2-token-refresh branch. Scoped to explicitly avoid the Certificate/OAuth2 branch of Connect-PfbArray.ps1, which the sibling branch is about to rewrite -- touching it here would create a guaranteed merge conflict.
juemerson-at-purestorage
pushed a commit
to juemerson-at-purestorage/fb-powershell
that referenced
this pull request
Jul 22, 2026
…pdate-pfbfilesystem-demote-v2 Add demote support to Update-PfbFileSystem (-DiscardNonSnapshottedData, -RequestedPromotionState)
juemerson-at-purestorage
added a commit
to juemerson-at-purestorage/fb-powershell
that referenced
this pull request
Jul 22, 2026
Fix dmann000#1 (-HttpTimeout is a no-op), Fix dmann000#2 (TLS 1.2 wrongly coupled to -IgnoreCertificateError), Fix dmann000#4 (Connect-PfbArray not reusing ConvertTo-PfbApiError) -- three issues found while auditing this code earlier, bundled into this branch since they touch the same file. Fix dmann000#3 (OAuth2 auto-reconnect) already became the sibling feature/connect-pfbarray-oauth2-token-refresh branch. Scoped to explicitly avoid the Certificate/OAuth2 branch of Connect-PfbArray.ps1, which the sibling branch is about to rewrite -- touching it here would create a guaranteed merge conflict.
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
A file-system demote (set a promoted/read-write FS to a read-only replication target) previously required dropping to raw REST. This adds two parameters to
Update-PfbFileSystem:-DiscardNonSnapshottedData(switch): sends thediscard_non_snapshotted_data=truequery param, required by the API when demoting.-RequestedPromotionState(promoted|demoted): setsrequested_promotion_statein the request body. Mutually exclusive with-Attributes(throws if both are supplied — no silent precedence).Resulting request:
Promote was already supported via
-Attributes @{ requested_promotion_state = 'promoted' }and is unchanged. Omitting the new switch produces the identical request as before this change — no regression to existing callers.Field names verified against
FB-2.26-openapi.json:discard_non_snapshotted_datais a query boolean,requested_promotion_stateis a writable PATCH body field with valuespromoted/demoted.Changes
Public/FileSystem/Update-PfbFileSystem.ps1— new params, body/query wiring, mutual-exclusion guard, comment-based help (+2 demote examples).PureStorageFlashBladePowerShell.psd1—ModuleVersion2.0.4 -> 2.0.5+ newv2.0.5ReleaseNotesentry.Tests/Update-PfbFileSystem.Demote.Tests.ps1— new Pester 5 suite (6 tests): switch present/absent, typed-param body, end-to-end demote shape,ValidateSetrejection, both-supplied guard.Test plan
Invoke-Pester Tests/Update-PfbFileSystem.Demote.Tests.ps1— 6/6 passbuild.ps1at repo root currently fails as committed onmainbecause it resolves$repoRootas if the script lived in<repo>/scripts/(introduced in the samefc6d8de1/ v2.0.4 commit), but the file is still at repo root. Unrelated to this PR — happy to open a separate fix if useful.