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?

posta 2 anni fa255 visualizzazioni
1 Risposta
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
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande