mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[macOS] Rework PowerShell installation (#4778)
This commit is contained in:
committed by
GitHub
parent
d8cbcdfd38
commit
cfacab19e6
@@ -2,7 +2,16 @@
|
||||
source ~/utils/utils.sh
|
||||
|
||||
echo Installing PowerShell...
|
||||
brew install --cask powershell
|
||||
psRelease=$(curl -s "https://api.github.com/repos/PowerShell/PowerShell/releases/latest")
|
||||
psDownloadUrl=$(echo $psRelease | jq -r '.assets[].browser_download_url | select(contains("osx-x64.pkg"))' | head -n 1)
|
||||
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
|
||||
if ! is_Less_BigSur; then
|
||||
sudo xattr -rd com.apple.quarantine /tmp/powershell.pkg
|
||||
fi
|
||||
|
||||
sudo installer -pkg /tmp/powershell.pkg -target /
|
||||
|
||||
# Install PowerShell modules
|
||||
psModules=$(get_toolset_value '.powershellModules[].name')
|
||||
|
||||
Reference in New Issue
Block a user