Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to `PureStorageFlashBladePowerShell` are documented in this file.

## [2.1.2] - 2026-07-20

API-drift cleanup: parameter-validation fixes and removal of three cmdlets that
never worked. Surfaced by the automated API drift report (module cross-checked
against the FlashBlade OpenAPI specs, REST 2.0-2.27).

### Removed

- Three cmdlets that modeled REST endpoints that **never existed** in any FlashBlade
API version (2.0-2.27) and always returned HTTP 405: `Remove-PfbSession`,
`New-PfbNetworkAccessPolicy`, `Remove-PfbNetworkAccessPolicy`. FlashBlade sessions
are read-only (`puresession` is list-only) and network-access policies are a fixed
built-in set (no create/delete) - only their *rules* are mutable, which is already
covered by `New-`/`Remove-PfbNetworkAccessRule`. Because these cmdlets never
succeeded, no working script depended on them.

### Fixed

- `Get-PfbArrayPerformance -Protocol`: added the documented `all` value (was missing
from the ValidateSet, so a valid call was rejected client-side).
- `New-PfbAlertWatcher -MinimumSeverity`: removed the invalid `error` value (not a
valid severity; the array would reject it).
- `New-PfbQuotaUser`: fixed a test that could hang on an interactive prompt when
neither `-UserName` nor `-UserId` was supplied.

### Added

- `Get-PfbArraySpace -Type`: added a ValidateSet (`array`, `file-system`,
`object-store`) matching the spec.

## [2.1.1] - 2026-07-15

Cross-platform and Windows PowerShell 5.1 fixes.
Expand Down
48 changes: 0 additions & 48 deletions Public/Admin/Remove-PfbSession.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions Public/Alert/New-PfbAlertWatcher.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function New-PfbAlertWatcher {
.PARAMETER Name
The email address of the watcher.
.PARAMETER MinimumSeverity
Minimum severity level for notifications ('warning', 'info', 'error', 'critical').
Minimum severity level for notifications ('info', 'warning', 'critical').
.PARAMETER Attributes
A hashtable of additional attributes.
.PARAMETER Array
Expand All @@ -19,7 +19,7 @@ function New-PfbAlertWatcher {
[string]$Name,

[Parameter()]
[ValidateSet('info', 'warning', 'error', 'critical')]
[ValidateSet('info', 'warning', 'critical')]
[string]$MinimumSeverity,

[Parameter()] [hashtable]$Attributes,
Expand Down
5 changes: 3 additions & 2 deletions Public/Array/Get-PfbArrayPerformance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function Get-PfbArrayPerformance {
.PARAMETER Array
The FlashBlade connection object. If not specified, uses the default connection.
.PARAMETER Protocol
Filter by protocol type: 'nfs', 'smb', 'http', 's3'.
Filter by protocol type: 'all', 'nfs', 'smb', 'http', 's3'. Defaults to 'all' (combined
performance of all available protocols) when omitted.
.PARAMETER Resolution
Time resolution for historical data in milliseconds.
.PARAMETER StartTime
Expand All @@ -25,7 +26,7 @@ function Get-PfbArrayPerformance {
[PSCustomObject]$Array,

[Parameter()]
[ValidateSet('nfs', 'smb', 'http', 's3')]
[ValidateSet('all', 'nfs', 'smb', 'http', 's3')]
[string]$Protocol,

[Parameter()]
Expand Down
4 changes: 3 additions & 1 deletion Public/Array/Get-PfbArraySpace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function Get-PfbArraySpace {
.PARAMETER Array
The FlashBlade connection object. If not specified, uses the default connection.
.PARAMETER Type
Filter by space type (e.g., 'array', 'file-system', 'object-store').
Filter by space type. Valid values: 'array', 'file-system', 'object-store'.
Defaults to 'array' if not specified.
.EXAMPLE
Get-PfbArraySpace
#>
Expand All @@ -17,6 +18,7 @@ function Get-PfbArraySpace {
[PSCustomObject]$Array,

[Parameter()]
[ValidateSet('array', 'file-system', 'object-store')]
[string]$Type
)

Expand Down
58 changes: 0 additions & 58 deletions Public/Policy/New-PfbNetworkAccessPolicy.ps1

This file was deleted.

53 changes: 0 additions & 53 deletions Public/Policy/Remove-PfbNetworkAccessPolicy.ps1

This file was deleted.

11 changes: 7 additions & 4 deletions PureStorageFlashBladePowerShell.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'PureStorageFlashBladePowerShell.psm1'
ModuleVersion = '2.1.1'
ModuleVersion = '2.1.2'
GUID = 'b25473b3-9eb7-414d-8da1-264e10f73d86'
Author = 'Pure Storage, Inc.'
CompanyName = 'Pure Storage, Inc.'
Expand Down Expand Up @@ -260,7 +260,6 @@
'New-PfbManagementAccessPolicy',
'New-PfbManagementAccessPolicyAdmin',
'New-PfbManagementAccessPolicyDirectoryRole',
'New-PfbNetworkAccessPolicy',
'New-PfbNetworkAccessRule',
'New-PfbNetworkInterface',
'New-PfbNetworkInterfaceTlsPolicy',
Expand Down Expand Up @@ -364,7 +363,6 @@
'Remove-PfbManagementAccessPolicy',
'Remove-PfbManagementAccessPolicyAdmin',
'Remove-PfbManagementAccessPolicyDirectoryRole',
'Remove-PfbNetworkAccessPolicy',
'Remove-PfbNetworkAccessRule',
'Remove-PfbNetworkInterface',
'Remove-PfbNetworkInterfaceTlsPolicy',
Expand Down Expand Up @@ -402,7 +400,6 @@
'Remove-PfbS3ExportRule',
'Remove-PfbSaml2Idp',
'Remove-PfbServer',
'Remove-PfbSession',
'Remove-PfbSmbClientPolicy',
'Remove-PfbSmbClientRule',
'Remove-PfbSmbSharePolicy',
Expand Down Expand Up @@ -551,6 +548,12 @@
LicenseUri = 'https://github.com/PureStorage-OpenConnect/flashblade-powershell/blob/main/LICENSE'
# ReleaseNotes carries only the latest-version highlight; full history is in CHANGELOG.md.
ReleaseNotes = @'
v2.1.2 - API-drift cleanup. Removes three cmdlets that modeled endpoints that never
existed in the FlashBlade API and always returned HTTP 405 (Remove-PfbSession,
New-/Remove-PfbNetworkAccessPolicy; network-access policy *rules* remain fully
supported via New-/Remove-PfbNetworkAccessRule). Also fixes parameter ValidateSets
on Get-PfbArrayPerformance -Protocol and New-PfbAlertWatcher -MinimumSeverity.

v2.1.1 - Cross-platform + Windows PowerShell 5.1 fixes.
Fixes a SecureString password truncation on Linux/macOS (affected encrypted-key JWT
signing and native username/password login, which silently used only the first
Expand Down
48 changes: 48 additions & 0 deletions Tests/Get-PfbArrayPerformance.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '5.0' }

BeforeAll {
Import-Module "$PSScriptRoot/../PureStorageFlashBladePowerShell.psd1" -Force
# A throwaway connection object; Assert-PfbConnection is mocked so its contents don't matter.
$script:fakeArray = [PSCustomObject]@{ Endpoint = 'fb.example.test'; ApiVersion = '2.0'; AuthToken = 'x' }
}

Describe 'Get-PfbArrayPerformance' {
BeforeEach {
Mock -ModuleName PureStorageFlashBladePowerShell Assert-PfbConnection { }
Mock -ModuleName PureStorageFlashBladePowerShell Invoke-PfbApiRequest { }
}

It 'ValidateSet on -Protocol includes exactly all, nfs, smb, http, s3' {
$command = Get-Command Get-PfbArrayPerformance
$validateSetAttr = $command.Parameters['Protocol'].Attributes |
Where-Object { $_ -is [System.Management.Automation.ValidateSetAttribute] }
$validateSetAttr.ValidValues | Should -Not -BeNullOrEmpty
($validateSetAttr.ValidValues | Sort-Object) | Should -Be (@('all', 'http', 'nfs', 's3', 'smb') | Sort-Object)
}

It 'accepts -Protocol all (regression: was rejected before the ValidateSet fix) and passes it through' {
{ Get-PfbArrayPerformance -Protocol all -Array $fakeArray } | Should -Not -Throw
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 1 -Exactly -ParameterFilter {
$Endpoint -eq 'arrays/performance' -and $QueryParams['protocol'] -eq 'all'
}
}

It 'still accepts pre-existing value -Protocol nfs unchanged' {
{ Get-PfbArrayPerformance -Protocol nfs -Array $fakeArray } | Should -Not -Throw
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 1 -Exactly -ParameterFilter {
$Endpoint -eq 'arrays/performance' -and $QueryParams['protocol'] -eq 'nfs'
}
}

It 'rejects an invalid -Protocol value with zero API calls' {
{ Get-PfbArrayPerformance -Protocol bogus -Array $fakeArray } | Should -Throw
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 0 -Exactly
}

It 'makes a call with no protocol query param when -Protocol is omitted' {
Get-PfbArrayPerformance -Array $fakeArray
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 1 -Exactly -ParameterFilter {
$Endpoint -eq 'arrays/performance' -and -not $QueryParams.ContainsKey('protocol')
}
}
}
39 changes: 39 additions & 0 deletions Tests/Get-PfbArraySpace.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '5.0' }

BeforeAll {
Import-Module "$PSScriptRoot/../PureStorageFlashBladePowerShell.psd1" -Force
$script:fakeArray = [PSCustomObject]@{ Endpoint = 'fb.example.test'; ApiVersion = '2.0'; AuthToken = 'x' }
}

Describe 'Get-PfbArraySpace' {
BeforeEach {
Mock -ModuleName PureStorageFlashBladePowerShell Assert-PfbConnection { }
Mock -ModuleName PureStorageFlashBladePowerShell Invoke-PfbApiRequest { }
}

It 'restricts -Type to the three real spec-documented values' {
$attr = (Get-Command Get-PfbArraySpace).Parameters['Type'].Attributes |
Where-Object { $_ -is [System.Management.Automation.ValidateSetAttribute] }
$attr | Should -Not -BeNullOrEmpty
$attr.ValidValues | Should -Be @('array', 'file-system', 'object-store')
}

It 'rejects an invalid -Type value before making any API call' {
{ Get-PfbArraySpace -Type 'bogus' -Array $fakeArray } | Should -Throw
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 0 -Exactly
}

It 'passes a valid -Type through to the query string' {
Get-PfbArraySpace -Type 'file-system' -Array $fakeArray
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 1 -Exactly -ParameterFilter {
$Method -eq 'GET' -and $Endpoint -eq 'arrays/space' -and $QueryParams['type'] -eq 'file-system'
}
}

It 'omits -Type from the query string when not specified (server defaults to array)' {
Get-PfbArraySpace -Array $fakeArray
Should -Invoke Invoke-PfbApiRequest -ModuleName PureStorageFlashBladePowerShell -Times 1 -Exactly -ParameterFilter {
-not $QueryParams.ContainsKey('type')
}
}
}
Loading
Loading