Skip to content

Commit f6964cf

Browse files
committed
Add verbose logging for PowerShell MSI installation
1 parent 3089353 commit f6964cf

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/cross-platform-test.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,21 @@ jobs:
4545
run: |
4646
# GitHub Actions has PowerShell 7.4 which uses .NET 8
4747
# PowerShell.MCP requires .NET 9, so we need PowerShell 7.5+
48+
$ErrorActionPreference = "Stop"
4849
$url = "https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.msi"
4950
$msiPath = "$env:TEMP\PowerShell-7.5.4-win-x64.msi"
50-
Invoke-WebRequest -Uri $url -OutFile $msiPath
51-
Start-Process msiexec.exe -Wait -ArgumentList "/i $msiPath /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=0 REGISTER_MANIFEST=1 USE_MU=0 ENABLE_MU=0 ADD_PATH=1"
51+
Write-Host "Downloading PowerShell 7.5.4..."
52+
Invoke-WebRequest -Uri $url -OutFile $msiPath -UseBasicParsing
53+
Write-Host "Downloaded to: $msiPath"
54+
Write-Host "File size: $((Get-Item $msiPath).Length) bytes"
55+
Write-Host "Installing PowerShell 7.5.4..."
56+
$process = Start-Process msiexec.exe -Wait -PassThru -ArgumentList "/i `"$msiPath`" /quiet /norestart /l*v `"$env:TEMP\pwsh_install.log`""
57+
Write-Host "MSI exit code: $($process.ExitCode)"
58+
if ($process.ExitCode -ne 0) {
59+
Write-Host "=== MSI Install Log ==="
60+
Get-Content "$env:TEMP\pwsh_install.log" -Tail 50
61+
throw "MSI installation failed with exit code $($process.ExitCode)"
62+
}
5263
# Verify installation
5364
& "C:\Program Files\PowerShell\7\pwsh.exe" --version
5465
shell: pwsh

0 commit comments

Comments
 (0)