11name : Install PowerShell
22description : >
3- Install a specific version —or the latest stable version— of PowerShell Core
3+ Install a specific version —or the latest stable version— of PowerShell Core
44 on any GitHub runner (Linux, macOS, Windows).
55 Skips the install if the requested version is already present.
66author : PSModule
@@ -15,7 +15,7 @@ inputs:
1515 Use `latest`, `null`, leave it **empty**, or omit the input entirely
1616 to grab the newest stable release automatically.
1717 required : false
18- default : ' ' # Empty string → newest release
18+ default : ' '
1919
2020runs :
2121 using : composite
2929 set -e
3030
3131 # Resolve empty / 'null' / 'latest' to a concrete version number
32- if [[ -z "$REQUESTED_VERSION" || \
33- "${REQUESTED_VERSION,,}" == "latest" || \
34- "${REQUESTED_VERSION,,}" == "null" ]]; then
32+ lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
33+ if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
3534 REQUESTED_VERSION=$(
3635 curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
3736 | grep -oP '"tag_name":\s*"\K([^"]+)' | sed 's/^v//'
8382 set -e
8483
8584 # Resolve empty / 'null' / 'latest' to a concrete version number
86- if [[ -z "$REQUESTED_VERSION" || \
87- "${REQUESTED_VERSION,,}" == "latest" || \
88- "${REQUESTED_VERSION,,}" == "null" ]]; then
85+ lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
86+ if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
8987 REQUESTED_VERSION=$(
9088 curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
9189 | grep -oP '"tag_name":\s*"\K([^"]+)' | sed 's/^v//'
0 commit comments