SSM Session Manager - Use Powershell 7

0

Hi,

Is there a way to set up Session Manager to use PowerShell 7?

asked a month ago73 views
1 Answer
0

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:

[+] Migrating from Windows PowerShell 5.1 to PowerShell 7

profile picture
answered a month ago
AWS
SUPPORT ENGINEER
revised a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions