Skip to main content
Pure1 Support Portal

Install PowerShell SDK using PowerShell Gallery

Starting with the PowerShell SDK 1.5.5.x the module can be installed from the  PowerShell Gallery. Installing from the PowerShell Gallery allows for quicker updates, no installation package downloads (i.e MSI) and can be deployed across a data center quickly to individual server nodes.

The steps below should be followed to use the PowerShell Gallery as your installation method.


  1. Visit Getting Started with the PowerShell Gallery to understand the requirements and setup required for using PowerShellGet. After configuring Windows PowerShell to support installing from the PowerShell Gallery we are ready to proceed with setup of the Pure Storage PowerShell SDK.
  2. Open a Windows PowerShell with Run as Administrator.
  3. To understand the different cmdlets that are part of PowerShellGet run the below command.
PS C:\> Get-Command -Module PowerShellGet
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Find-Command                                 PowerShellGet
Function        Find-DscResource                             PowerShellGet
Function        Find-Module                                  PowerShellGet
Function        Find-RoleCapability                          PowerShellGet
Function        Find-Script                                  PowerShellGet
Function        Get-InstalledModule                          PowerShellGet
Function        Get-InstalledScript                          PowerShellGet
Function        Get-PSRepository                             PowerShellGet
Function        Install-Module                               PowerShellGet
Function        Install-Script                               PowerShellGet
Function        New-ScriptFileInfo                           PowerShellGet
Function        Publish-Module                               PowerShellGet
Function        Publish-Script                               PowerShellGet
Function        Register-PSRepository                        PowerShellGet
Function        Save-Module                                  PowerShellGet
Function        Save-Script                                  PowerShellGet
Function        Set-PSRepository                             PowerShellGet
Function        Test-ScriptFileInfo                          PowerShellGet
Function        Uninstall-Module                             PowerShellGet
Function        Uninstall-Script                             PowerShellGet
Function        Unregister-PSRepository                      PowerShellGet
Function        Update-Module                                PowerShellGet
Function        Update-ModuleManifest                        PowerShellGet
Function        Update-Script                                PowerShellGet
Function        Update-ScriptFileInfo                        PowerShellGet
  1. Install the PowerShell SDK using theInstall-Module cmdlet.
Install-Module -Name PureStoragePowerShellSDK
  1. Once the above cmdlet is executed you will see the below warning if the PowerShell Gallery (i.e. PSGallery) has not been setup as a Trusted Repository.
PS C:\> Install-Module -Name PureStoragePowerShellSDK

Untrusted repository
You are installing the modules from an untrusted repository. If you
trust this repository, change its InstallationPolicy value by running
the Set-PSRepository cmdlet. Are you sure you want to install the
modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "N"):
  1. Choose [N] No to exit and set the PSGallery repository to Trusted in order to avoid this issue in the future.
PS C:\> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Untrusted  

PS C:\> Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
PS C:\> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Trusted    

PS C:\>
  1. Re-run the below command to install. Depending on your connection the download and installation could take a moment. When the installation starts a Windows PowerShell status notification will display in the session window.
Install-Module -Name PureStoragePowerShellSDK
  1. After installing the SDK check that it was installed using the below command. This will return a list of all available scripts and binaries.
PS C:\> Get-Module -ListAvailable

    Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.1      Microsoft.PowerShell.Operation.V... {Get-OperationValidation, Invoke-OperationValidation}
Binary    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider,...
Binary    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider,...
Script     3.4.0      Pester                              {Describe, Context, It, Should...}
Script    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}
Script     1.2        PSReadline                          {Get-PSReadlineKeyHandler, Set-PSReadlineKeyHandler, Remove-...
Binary    PureStoragePowerShellSDK            {Disable-PfaAlert, Enable-PfaAlert, Get-PfaAlert, Get-PfaAlerts...}

When installing from the PowerShell Gallery the module or script will be located in C:\Program Files\WindowsPowerShell\Modules in the respective directory name. (i.e. PureStoragePowerShellSDK).

  1. After installation has completed and verified the PowerShell SDK is ready for use. To see what is available use the below. There are 247 cmdlets in the SDK
PS C:\> Get-Command -Module PureStoragePowerShellSDK | more
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Add-PfaHostGroupsToProtectionGroup           PureStoragePowerShellSDK
Cmdlet          Add-PfaHostIqns                              PureStoragePowerShellSDK
Cmdlet          Add-PfaHosts                                 PureStoragePowerShellSDK
Cmdlet          Add-PfaHostsToProtectionGroup                PureStoragePowerShellSDK
Cmdlet          Add-PfaHostWwns                              PureStoragePowerShellSDK
Cmdlet          Add-PfaSlaveInterfaces                       PureStoragePowerShellSDK
Cmdlet          Add-PfaTargetArrays                          PureStoragePowerShellSDK
Cmdlet          Add-PfaVolumesToProtectionGroup              PureStoragePowerShellSDK
Cmdlet          Clear-PfaItemFlag                            PureStoragePowerShellSDK
Cmdlet          Disable-PfaAlert                             PureStoragePowerShellSDK
Cmdlet          Disable-PfaIdLight                           PureStoragePowerShellSDK
Cmdlet          Disable-PfaNetworkInterface                  PureStoragePowerShellSDK
Cmdlet          Disable-PfaReplicationSchedule               PureStoragePowerShellSDK
Cmdlet          Disable-PfaSnapshotSchedule                  PureStoragePowerShellSDK
-- More  --