Skip to content

Commit d13e05c

Browse files
Refactor action.yml: improve PowerShell version detection logic and enhance output messaging for clarity
1 parent e924d13 commit d13e05c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ runs:
8181
shell: powershell
8282
run: |
8383
try {
84-
$detected = (& pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()')
84+
$detected = (pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()')
8585
} catch {
8686
$detected = $null
8787
}
8888
89+
Write-Host "Detected PowerShell version: $detected"
90+
8991
if ($detected -eq $env:REQUESTED_VERSION) {
9092
Write-Host "PowerShell $detected already installed. Skipping."
9193
exit 0

0 commit comments

Comments
 (0)