Skip to content

Commit

Permalink
Merge pull request #721 from rlakey/fix-pwsh-detection-for-windows
Browse files Browse the repository at this point in the history
Fix for Windows w/pwsh installed for vmware train
  • Loading branch information
clintoncwolfe authored Sep 30, 2022
2 parents 349b7f8 + fdae263 commit 297634c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/train/transports/vmware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ def uri
private

def detect_powershell_binary
if find_executable0("pwsh")
:pwsh
elsif find_executable0("powershell")
# Detect Powershell first in case of Windows with Powershell 6/7/Core installed as flush_stdout/stderr doesn't work for pwsh on Windows.
if find_executable0("powershell")
:powershell
elsif find_executable0("pwsh")
:pwsh
else
raise "Cannot find PowerShell binary, is `pwsh` installed?"
end
Expand Down

0 comments on commit 297634c

Please sign in to comment.