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?

preguntada hace 2 años255 visualizaciones
1 Respuesta
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 hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas