Skip to main content
Pure Technical Services

Using the FlashArray PowerShell SDK v2 with MacOS and Linux

Currently viewing public documentation. Please login to access the full scope of documentation.

 

This article is for the PowerShell SDK version 2.

This article will cover using the PowerShell SDK v2 with PowerShell version 7.x and the MacOS and Linux operating systems.

The PowerShell SDK supports compatibility with specifically tested Microsoft PowerShell officially supported MacOS versions and Linux distributions. Currently, the MacOS versions tested for compatibility is 10.15.5 (catalina) or later. The Linux distributions tested are Ubuntu 18.04, 20.04, and Debian 10. Other PowerShell supported Linux distributions may work, but have not been tested. Please refer to the latest Release Notes for any updates on compatibility.

 

Introduction

Starting with the PowerShell SDK version 2.2, we now support importing the module on selected MacOS versions and Linux distributions that are also officially supported by Microsoft for PowerShell. This introduces the ability for multi-platform integration, administration, and scripting with the FlashArray.

Installation

  • Follow the installation instructions at this Microsoft page to install PowerShell on you Mac or Linux instance.
  • Open a terminal window and start a PowerShell session by entering
user@Linux$ pwsh
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/user>
  • Follow these instructions to download and install the Pure Storage PowerShell SDK version 2 from the PowerShell Gallery to your instance.
  • Import the module. By default, the Install-Module cmdlet places the user module files in the ~/.local/share/powershell/Modules folder. This path may be different based on your distribution, or if you manually move or copy the module files.

The module should be loaded with the .PSD1 file, as shown below (the module manifest file). This is due to the fact that the module is a DLL and not a .PSM1 file. This ensures you have all of the metadata available to the module for use.

PS /home/user> Import-Module -Name PureStoragePowerShellSDK2.psd1
  • Once imported, verify that the module is loaded by issuing this command at a PowerShell prompt:
PS /home/user> Get-Module -Name PureStoragePowerShellSDK2
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     2.2.272.0             PureStoragePowerShellSDK2           {Connect-Pfa2Array, Disconnect-Pfa2Array, Get-Pfa2Admin, Get-Pfa2Admi…