Skip to content

Commit 0777397

Browse files
pwsh-preview for Preview, not pwsh
1 parent 359723c commit 0777397

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/Action-Test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ jobs:
7272
}
7373
7474
# Actual version installed by the action
75-
$installed = ($PSVersionTable.PSVersion).ToString()
75+
# Preview builds install the executable named 'pwsh-preview' on Windows,
76+
# so query that binary
77+
if ('${{ matrix.version }}'.Trim().ToLower() -eq 'preview' -and $IsWindows) {
78+
$installed = (pwsh-preview -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()')
79+
} else {
80+
$installed = ($PSVersionTable.PSVersion).ToString()
81+
}
7682
Write-Host "Installed PowerShell version: $installed"
7783
Write-Host "Expected PowerShell version: $requested"
7884

0 commit comments

Comments
 (0)