From 8c2a400be2bc5364398d5fcfce2c2817dc451b25 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:05:15 +0100 Subject: [PATCH] [macOS] Pin PowerShell version 7.2.7 (#6596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”> --- images/macos/provision/core/powershell.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/core/powershell.sh b/images/macos/provision/core/powershell.sh index e3fdc86b..611dbbdf 100644 --- a/images/macos/provision/core/powershell.sh +++ b/images/macos/provision/core/powershell.sh @@ -2,7 +2,9 @@ source ~/utils/utils.sh echo Installing PowerShell... -psDownloadUrl=$(get_github_package_download_url "PowerShell/PowerShell" "contains(\"osx-x64.pkg\")" "latest" "$API_PAT") +psmetadata=$(curl "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json" -s) +psver=$(echo $psmetadata | jq -r '.LTSReleaseTag[0]') +psDownloadUrl=$(get_github_package_download_url "PowerShell/PowerShell" "contains(\"osx-x64.pkg\")" "$psver" "$API_PAT") download_with_retries $psDownloadUrl "/tmp" "powershell.pkg" # Work around the issue on macOS Big Sur 11.5 or higher for possible error message ("can't be opened because Apple cannot check it for malicious software") when installing the package