Once an active session to the FlashArray is established, the array object can be passed to other cmdlets. With previous SDK versions, in order to use the current session, the
$FlashArray variable would be used in all subsequent cmdlets for the
-Array parameter. This is no longer necessary in SDK version 2.x and is only required when multiple array connections are used within the same session. In the below example, the FlashArray controller details are retrieved.
The
Get-Pfa2Controller cmdlet requires Purity API version 2.2. if your array only supports Purity version 2.1 or earlier, the cmdlet will error.
Please see this matrix guide for more information on SDK v2 cmdlets and their implemented API versions.
PS C:\> Get-Pfa2Controller
Name : CT0
Mode : primary
Model : FA-x70
Status : ready
Type : array_controller
Version : 6.0.0
Name : CT1
Mode : secondary
Model : FA-x70
Status : ready
Type : array_controller
Version : 6.0.0
Any time information is retrieved from the FlashArray (GET operations) and assigned to variable, it will return a PowerShell Object (PSObject). With the information stored as a PSObject, individual properties can be queried, used as part of the pipeline, or simply formatted.
PS C:\> $Controllers = Get-Pfa2Controller
PS C:\> $Controllers.Item(0)
Name : CT0
Mode : primary
Model : FA-x70
Status : ready
Type : array_controller
Version : 6.0.0
PS C:\> $Controllers.Item(1)
Name : CT1
Mode : secondary
Model : FA-x70
Status : ready
Type : array_controller
Version : 6.0.0
PS C:\> $Controllers.Item(1).Name
CT1
PS C:\> $Controllers.Item(1).Model
FA-x70
PS C:\>
You could pipe the variable to the PowerShell cmdlet
Get-Member to retrieve all the available properties and methods returned from the PSObject. In this example, you would issue a
$Controllers | Get-Member to view the available objects.