2525 run : |
2626 set -e
2727
28- echo "Detecting existing PowerShell on Linux… "
28+ echo "Detecting existing PowerShell on Linux... "
2929 DETECTED_VERSION=$(pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' 2>/dev/null || true)
3030 echo "Detected version: ${DETECTED_VERSION:-<none>}"
3131 echo "Requested version: $REQUESTED_VERSION"
@@ -49,30 +49,30 @@ runs:
4949 # Debian/Ubuntu installation
5050 # -------------------------------------------------------------------------------------------------
5151 if command -v apt-get >/dev/null; then
52- echo "Using APT package manager (Debian/Ubuntu)… "
52+ echo "Using APT package manager (Debian/Ubuntu)... "
5353
54- echo "Ensuring Microsoft package repo is configured… "
54+ echo "Ensuring Microsoft package repo is configured... "
5555 if ! grep -q "packages.microsoft.com" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then
5656 wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc > /dev/null
5757 DIST_CODENAME=$(lsb_release -cs)
5858 sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/ubuntu/$DIST_CODENAME/prod $DIST_CODENAME main"
5959 fi
6060
61- echo "Updating package index… "
61+ echo "Updating package index... "
6262 sudo apt-get update -y
6363
6464 if [[ "$DECISION" != "install" ]]; then
65- echo "Removing any existing PowerShell packages… "
65+ echo "Removing any existing PowerShell packages... "
6666 sudo apt-get remove -y powershell || true
6767 sudo apt-get autoremove -y || true
6868 fi
6969
70- echo "Attempting to install exact version $REQUESTED_VERSION from repo… "
70+ echo "Attempting to install exact version $REQUESTED_VERSION from repo... "
7171 EXACT_PKG=$(apt-cache madison powershell | awk '{print $3}' | grep -E "^${REQUESTED_VERSION}(-|$)" | head -n1 || true)
7272 if [[ -n "$EXACT_PKG" ]]; then
7373 sudo apt-get install -y powershell=$EXACT_PKG
7474 else
75- echo "Exact version not found in repo; downloading .deb package from GitHub release… "
75+ echo "Exact version not found in repo; downloading .deb package from GitHub release... "
7676 ARCH=$(dpkg --print-architecture)
7777 DEB_NAME="powershell_${REQUESTED_VERSION}-1.deb_${ARCH}.deb"
7878 URL="https://github.com/PowerShell/PowerShell/releases/download/v${REQUESTED_VERSION}/${DEB_NAME}"
9595 run : |
9696 set -e
9797
98- echo "Detecting existing PowerShell on macOS… "
98+ echo "Detecting existing PowerShell on macOS... "
9999 DETECTED_VERSION=$(pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' 2>/dev/null || true)
100100 echo "Detected version: ${DETECTED_VERSION:-<none>}"
101101 echo "Requested version: $REQUESTED_VERSION"
@@ -113,14 +113,14 @@ runs:
113113 if [[ "$DECISION" == "skip" ]]; then
114114 echo "Skipping installation on macOS (exact version present)."
115115 else
116- echo "Uninstalling any existing PowerShell… "
116+ echo "Uninstalling any existing PowerShell... "
117117 brew uninstall --ignore-dependencies --force powershell || true
118118
119- echo "Attempting to install PowerShell $REQUESTED_VERSION via Homebrew… "
119+ echo "Attempting to install PowerShell $REQUESTED_VERSION via Homebrew... "
120120 if brew info --cask powershell@$REQUESTED_VERSION >/dev/null 2>&1; then
121121 brew install --cask powershell@$REQUESTED_VERSION
122122 else
123- echo "Exact version not available via Homebrew; downloading .pkg from GitHub release… "
123+ echo "Exact version not available via Homebrew; downloading .pkg from GitHub release... "
124124 ARCH=$(uname -m)
125125 if [[ "$ARCH" == "arm64" ]]; then PKG_NAME="powershell-${REQUESTED_VERSION}-osx-arm64.pkg"; else PKG_NAME="powershell-${REQUESTED_VERSION}-osx-x64.pkg"; fi
126126 URL="https://github.com/PowerShell/PowerShell/releases/download/v${REQUESTED_VERSION}/${PKG_NAME}"
@@ -137,7 +137,7 @@ runs:
137137 REINSTALL : ${{ inputs.Reinstall }}
138138 shell : powershell
139139 run : |
140- Write-Host "Detecting existing PowerShell on Windows… "
140+ Write-Host "Detecting existing PowerShell on Windows... "
141141 try {
142142 $detected = (& pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()')
143143 } catch {
@@ -165,14 +165,14 @@ runs:
165165 if ($decision -eq 'skip') {
166166 Write-Host 'Skipping installation on Windows (exact version present).'
167167 } else {
168- Write-Host 'Removing existing PowerShell installation (if any)… '
168+ Write-Host 'Removing existing PowerShell installation (if any)... '
169169 $pwshProducts = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like 'PowerShell*' }
170170 foreach ($p in $pwshProducts) {
171- Write-Host "Uninstalling $($p.Name)… "
171+ Write-Host "Uninstalling $($p.Name)... "
172172 Start-Process msiexec.exe -ArgumentList '/x', $p.IdentifyingNumber, '/quiet', '/norestart' -Wait
173173 }
174174
175- Write-Host "Installing PowerShell $env:REQUESTED_VERSION… "
175+ Write-Host "Installing PowerShell $env:REQUESTED_VERSION... "
176176 $msi = "PowerShell-$($env:REQUESTED_VERSION)-win-x64.msi"
177177 $url = "https://github.com/PowerShell/PowerShell/releases/download/v$($env:REQUESTED_VERSION)/$msi"
178178 Invoke-WebRequest -Uri $url -OutFile $msi -UseBasicParsing
0 commit comments