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?

feita há 2 anos255 visualizações
1 Resposta
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
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas