Added support for PS Core to fix #11085powershell-fix
Added an additional path check for "pwsh" to detect versionf of PowerShell Core that may be on the user's PATH. This also opens up the possibility of removing Windows specific references in this file, as Core can be installed on Linux and mac OS, giving us the ability to expand Powershell into a cross-platform plugin. Signed-off-by: Scott Simontis <yo@scottsimontis.io>
This commit is contained in:
parent
b03f8f5aac
commit
2a7582e896
|
@ -15,6 +15,7 @@ module Vagrant
|
|||
# Number of seconds to wait while attempting to get powershell version
|
||||
DEFAULT_VERSION_DETECTION_TIMEOUT = 30
|
||||
LOGGER = Log4r::Logger.new("vagrant::util::powershell")
|
||||
POWERSHELL_CORE_EXE = "pwsh"
|
||||
|
||||
# @return [String|nil] a powershell executable, depending on environment
|
||||
def self.executable
|
||||
|
@ -34,6 +35,8 @@ module Vagrant
|
|||
@_powershell_executable = nil
|
||||
end
|
||||
end
|
||||
elsif !Which.which(POWERSHELL_CORE_EXE).nil?
|
||||
@_powershell_executable = POWERSHELL_CORE_EXE
|
||||
else
|
||||
@_powershell_executable = nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue