- Newest
- Most votes
- Most comments
While Session Manager doesn't have a direct setting to use PowerShell 7 by default, Windows server comes with PowerShell 5.1 version. However you can use PowerShell version 7 by customizing your approach after starting a session.
-
Install PowerShell 7 on a Windows instance.[+]
-
Connect to the SSM session manager.
-
Start PowerShell 7 by switching to new pwsh.exe using below command, as default path when we install PS 7.
& 'C:\Program Files\PowerShell\7\pwsh.exe'
-
Verify version of PowerShell that was being used using below command:
$PSVersionTable
The default location of the PowerShell executable is at "C:\Windows\System32\WindowsPowerShell\v1.0" which is built into the OS and PowerShell 7 is one installed alongside PowerShell 5 and not an upgrade.
Remember that PowerShell 7 needs to be installed on the target EC2 instance for these methods to work.
Sources:
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 16 days ago