1 Answer
- Newest
- Most votes
- Most comments
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"
answered 2 years ago
Relevant content
- asked 2 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago