Skip to content

Running the aws update command in the PowerShell 7 console fails. #10532

Closed

Description

@stknohg

Describe the bug

My environment is PowerShell 7.6.4 on Windows 11 and Windows Server 2025.
The console is running with administrator privileges.

# PowerShell 7.6.4
PS C:\> aws --version
aws-cli/2.36.0 Python/3.14.6 Windows/2025Server exec-env/EC2 exe/AMD64

When I run the aws update command in the PowerShell 7 console, the installation script executes in a separate window, downloads the latest version of the MSI installer file, and then immediately exits.

When I ran the downloaded aws-update.cmd, it failed to load the Get-AuthenticodeSignature cmdlet.

# Run the downloaded aws-update.cmd to reproduce the issue.
PS C:\Users\Administrator\AppData\Local\Temp\2\tmpy48h7xd1> .\aws-update.cmd
Installing AWS CLI 2.36.0 -> 2.36.15
Downloading AWS CLI installer from https://awscli.amazonaws.com/AWSCLIV2-2.36.15.msi?src=update-exe
aws-cli installer: error: The 'Get-AuthenticodeSignature' command was found in the module 'Microsoft.PowerShell.Security', but the module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The script continues without errors, and the MSI installer runs.

Current Behavior

The script terminates after failing to load the Get-AuthenticodeSignature cmdlet.

Reproduction Steps

Run the aws update command in a PowerShell 7 console.

Possible Solution

aws update command launches Windows PowerShell to execute the update script, but because it inherits the PSModulePath environment variable from the PowerShell 7 environment, the module resolution order is not as intended.

# Default PowerShell 7 PSModulePath: 
PS C:\> $env:PSModulePath
C:\Users\Administrator\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules

# Default Windows PowerShell PSModulePath: 
PS C:\> $env:PSModulePath
C:\Users\Administrator\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules

The direct cause is that the Windows PowerShell script references C:\Program Files\PowerShell\Modules.
Adjusting the search order of PSModulePath will resolve the error.

To take an extreme example, the issue can be resolved by modifying aws-update.cmd as follows.

@echo off
set AWS_CLI_DISTRIBUTION_SOURCE_OVERRIDE=update-exe
ping -n 3 127.0.0.1 >nul 2>&1

REM Set PSModulePath to a fixed value.
set PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE" -NoProfile -File "C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpy48h7xd1\install.ps1" -System

Additional Information/Context

Incidentally, running the aws update command in the PowerShell 5.1 console completes successfully.

CLI version used

2.36.0

Environment details (OS name and version, etc.)

PowerShell 7 on Windows 11, Windows Server 2025

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Aug 4, 2026
  2. stknohg commented on Aug 4, 2026

    @stknohg
    Author

    Workaround is to execute install.ps1 directly in PowerShell 7 console.

    # system install
    Invoke-Expression "& { $(Invoke-RestMethod 'https://awscli.amazonaws.com/v2/install.ps1') } -System"
    
    # user install
    Invoke-RestMethod -Uri https://awscli.amazonaws.com/v2/install.ps1 | Invoke-Expression
  3. added
    investigatingThis issue is being investigated and/or work is in progress to resolve the issue.
    p2This is a standard priority issue
    and removed
    needs-triageThis issue or PR still needs to be triaged.
    on Aug 4, 2026
  4. hssyoo commented on Aug 10, 2026

    @hssyoo
    Contributor

    @stknohg Thanks for raising this issue and providing details. I was able to reproduce the same issue in a PS7 console.

    The root cause is that the update command launches a PS5 console to execute the install script and inherit's PS7's PSModulePath value, causing incompatibility. This explains why update succeeds on PS5.

    I cut a PR to fix this issue: #10541. Once it's merged and released, upgrading to the latest AWS CLI v2 version should resolve the issue.

  5. removed
    investigatingThis issue is being investigated and/or work is in progress to resolve the issue.
    on Aug 11, 2026
  6. hssyoo commented on Aug 12, 2026

    @hssyoo
    Contributor

    Fix was released in version 2.36.21. After installing 2.36.21, I was able to successfully run aws update in a PS7 console and confirmed that it updated to 2.36.22.

  7. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

  8. removed their assignment
    on Aug 13, 2026
  9. stknohg commented on Aug 13, 2026

    @stknohg
    Author

    @hssyoo
    Thank you for handling this.
    I have confirmed that the update from Ver. 2.36.21 to Ver. 2.36.22 completed successfully without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.p2This is a standard priority issueupdate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions