EC2 backups fail with AWS Tools for Windows PowerShell is not installed
Problem description
EC2 backups fail with 'AWS Tools for Windows PowerShell is not installed'
Cause
Proper version of the AWSPowerShell module is not installed.
Sample output of incorrect modules:
PS C:\Temp>Get-Module -ListAvailable | Where-Object {$_.Name -like "*AWS*" ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 4.1.113 AWS.Tools.Common {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize…}
Binary 4.1.113 AWS.Tools.EC2 {Add-EC2CapacityReservation, Add-EC2ClassicLinkVpc, Add-EC…}
Binary 4.1.113 AWS.Tools.S3 {Add-S3PublicAccessBlock, Copy-S3Object, Get-S3ACL, Get-S3…}
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 4.1.113 AWS.Tools.IdentityManagement {Add-IAMClientIDToOpenIDConnectProvider, Add-IAMInstancePr…}
Script 1.0.2.4 AWS.Tools.Installer {Uninstall-AWSToolsModule, Install-AWSToolsModule, Update-...}
In above example, the AWSPowerShell module is missing.
Resolution
Run the following command in an elevated PowerShell Session to install the latest version of the AWSPowerShell module.
Install-Module -Name AWSPowerShell -Force -AllowClobber -SkipPublisherCheck
Verification
Run the following command, and verify that the AWSPowershell module is installed:
Get-Module -ListAvailable | Where-Object {$_.Name -like "*AWS*" }
Sample of a working install:
PS C:\Temp>Get-Module -ListAvailable | Where-Object {$_.Name -like "*AWS*"
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 4.1.16.0 AWSPowerShell {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize-AWSDefaultConfiguration, Clear-AWSDefaultConfiguration...}
Binary 4.1.113 AWS.Tools.Common {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize…}
Binary 4.1.113 AWS.Tools.EC2 {Add-EC2CapacityReservation, Add-EC2ClassicLinkVpc, Add-EC…}
Binary 4.1.113 AWS.Tools.S3 {Add-S3PublicAccessBlock, Copy-S3Object, Get-S3ACL, Get-S3…}
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 4.1.16.0 AWSPowerShell {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize-AWSDefaultConfiguration, Clear-AWSDefaultConfiguration...}
Binary 4.1.113 AWS.Tools.IdentityManagement {Add-IAMClientIDToOpenIDConnectProvider, Add-IAMInstancePr…}
Script 1.0.2.4 AWS.Tools.Installer {Uninstall-AWSToolsModule, Install-AWSToolsModule, Update-...}