powershellaws-powershell

WARNING: Multiple variants of AWS Tools for PowerShell are currently installed


When I run a powershell script, I get the following warning:

WARNING: Multiple variants of AWS Tools for PowerShell (AWSPowerShell, AWSPowerShell.NetCore or AWS.Tools) are currently installed. Please run 'Get-Module -Name AWSPowerShell,AWSPowerShell.NetCore,AWS.Tools.Common -ListAvailable' for details. To avoid problems with cmdlet auto-importing, it is suggested to only install one variant. AWS.Tools is the new modularized version of AWS Tools for PowerShell, compatible with PowerShell Core 6+ and Windows Powershell 5.1+ (when .NET Framework 4.7.2+ is installed). AWSPowerShell.NetCore is the monolithic variant that supports all AWS services in a single large module, it is compatible with PowerShell Core 6+ and Windows Powershell 3+ (when .NET Framework 4.7.2+ is installed). AWSPowerShell is the legacy module for older systems which are either running Windows PowerShell 2 or cannot be updated to .NET Framework 4.7.2 (or newer).

Screenshot:

enter image description here

How do I fix the warning? Do I uninstall one or 2 of these modules? Which ones?


Solution

  • Going purely by the error message:

    How do I fix the warning?

    You ensure that only one of the three listed module (groups) is installed:

    Do I uninstall one or 2 of these modules? Which ones?

    Yes. Which ones to uninstall and thereby implicitly which one to keep depends on your needs and which powershell version you have:

    For instance, to go with (a):

    Note

    Get-Module -ListAvailable AWSPowerShell, AWSPowerShell.NetCore |
      Uninstall-Module -Force