Specify Powershell 7 when running SSM scripts

1

Is there a way to specify, on Windows, that the SSM Agent runs a powershell script using PowerShell 7 vs. PowerShell 5?

질문됨 2년 전255회 조회
1개 답변
1

Unfortunately, it is not possible to specify the PowerShell version while running a AWS-RunPowerShellScript run command. However, you can work around it by calling PowerShell 7 and pass a command/script. The following invokes a PowerShell 7 command of Get-Host.

& "C:\Program Files\PowerShell 7\pwsh.exe" -Command "Get-Host"
AWS
Taka_M
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠