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.

Steps

  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                                       1.0.0.1    PowerShellGet
Function        Find-DscResource                                   1.0.0.1    PowerShellGet
Function        Find-Module                                        1.0.0.1    PowerShellGet
Function        Find-RoleCapability                                1.0.0.1    PowerShellGet
Function        Find-Script                                        1.0.0.1    PowerShellGet
Function        Get-InstalledModule                                1.0.0.1    PowerShellGet
Function        Get-InstalledScript                                1.0.0.1    PowerShellGet
Function        Get-PSRepository                                   1.0.0.1    PowerShellGet
Function        Install-Module                                     1.0.0.1    PowerShellGet
Function        Install-Script                                     1.0.0.1    PowerShellGet
Function        New-ScriptFileInfo                                 1.0.0.1    PowerShellGet
Function        Publish-Module                                     1.0.0.1    PowerShellGet
Function        Publish-Script                                     1.0.0.1    PowerShellGet
Function        Register-PSRepository                              1.0.0.1    PowerShellGet
Function        Save-Module                                        1.0.0.1    PowerShellGet
Function        Save-Script                                        1.0.0.1    PowerShellGet
Function        Set-PSRepository                                   1.0.0.1    PowerShellGet
Function        Test-ScriptFileInfo                                1.0.0.1    PowerShellGet
Function        Uninstall-Module                                   1.0.0.1    PowerShellGet
Function        Uninstall-Script                                   1.0.0.1    PowerShellGet
Function        Unregister-PSRepository                            1.0.0.1    PowerShellGet
Function        Update-Module                                      1.0.0.1    PowerShellGet
Function        Update-ModuleManifest                              1.0.0.1    PowerShellGet
Function        Update-Script                                      1.0.0.1    PowerShellGet
Function        Update-ScriptFileInfo                              1.0.0.1    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            https://www.powershellgallery.com/api/v2/

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

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2/

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     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider,...
Binary     1.0.0.0    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider,...
Script     3.4.0      Pester                              {Describe, Context, It, Should...}
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}
Script     1.2        PSReadline                          {Get-PSReadlineKeyHandler, Set-PSReadlineKeyHandler, Remove-...
Binary     1.6.6.0    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 1.6.6.0.
PS C:\> Get-Command -Module PureStoragePowerShellSDK | more
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Add-PfaHostGroupsToProtectionGroup                 1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaHostIqns                                    1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaHosts                                       1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaHostsToProtectionGroup                      1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaHostWwns                                    1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaSlaveInterfaces                             1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaTargetArrays                                1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Add-PfaVolumesToProtectionGroup                    1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Clear-PfaItemFlag                                  1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Disable-PfaAlert                                   1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Disable-PfaIdLight                                 1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Disable-PfaNetworkInterface                        1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Disable-PfaReplicationSchedule                     1.6.6.0    PureStoragePowerShellSDK
Cmdlet          Disable-PfaSnapshotSchedule                        1.6.6.0    PureStoragePowerShellSDK
-- More  --