Skip to content

[v2] Avoid PSModulePath inheritance during update on Windows - #10541

Open
hssyoo wants to merge 1 commit into
aws:v2from
hssyoo:fix-ps7-update
Open

[v2] Avoid PSModulePath inheritance during update on Windows#10541
hssyoo wants to merge 1 commit into
aws:v2from
hssyoo:fix-ps7-update

Conversation

@hssyoo

@hssyoo hssyoo commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #10532

Currently, update launches a PS5 console via powershell.exe when running the install script. This causes an issue where if the update command is run within a PS7 console, the PS5 execution inherits PS7's PSModulePath env var value, leading to path issues when the install script attempts to run Get-AuthenticodeSignature.

This PR fixes the issue by removing PSModulePath before launching PS5, letting it rebuild its default PSModulePath value. The PR also falls back to pwsh.exe (PS7) if powershell.exe isn't available when resolving the PowerShell path.

@hssyoo
hssyoo requested a review from a team as a code owner August 10, 2026 17:05
@aemous aemous added accessanalyzer v2 update customization Issues related to CLI customizations (located in /awscli/customizations) bug This issue is a bug. and removed accessanalyzer labels Aug 10, 2026
@aemous
aemous self-requested a review August 10, 2026 17:53
@aemous aemous self-assigned this Aug 10, 2026

@aemous aemous left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Confirmed via internal discussions that this was manually tested on a Windows machine.

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

Labels

bug This issue is a bug. customization Issues related to CLI customizations (located in /awscli/customizations) update v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants