PowerShell 5.x

Microsoft Platform Guide

Audience
Public
Source Type
Documentation

PowerShell 5.x by default does not have the updated version of PowerShellGet which is required for prereleases. For GA releases, simply use the Install-Module cmdlet.

Install-Module purestorage.flasharray.backup

In the future we may release new functionality as a prerelease. With PowerShell 5.x, by default, you will see the error in Figure 1.

Figure 1. -AllowPrerelease error in PowerShell 5.x

Note:

Not all environments support or allow later versions of PowerShell. Installing the beta Backup Module requires PowerShellGet 2.x. Even Windows Server 2022's version of PowerShell ships with PowerShellGet 1.0.0.1. PowerShell 5.x requires installing a newer version of NuGet and then the newer version of PowerShellGet. That also means if you tried to use Update-Module for NuGet, it would fail since 1.0.0.1 exists unless it is manually removed.

Be sure to close all PowerShell sessions, open a new one as administrator, and install the module. If you attempt to unload PowerShellGet 1.0.0.1 and load the newer version you will probably get an error when attempting to use Install-Module.

Below are the instructions to install the Backup Module with PowerShell 5.x with the right versions of NuGet and PowerShellGet.

  1. Install NuGet with a minimum version of of 2.8.5.201 with the command below. An example is shown in Figure 2. Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force Figure 2. Installing NuGet for Backup Module
  2. Install PowerShellGet with the command below. An example is shown in Figure 3. Install-Module -Name PowerShellGet -Force Figure 3. Installing PowerShellGet
  3. Install the Backup Module with the command below. An example is shown in Figure 3. When prompted about the untrusted repository, enter Y for yes. An example is shown in Figure 4. Install-Module -AllowPrerelease purestorage.flasharray.backup Figure 4. Installing Backup Module