Class: PuppetX::PuppetLabs::Dsc::CompatiblePowerShellVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/compatible_powershell_version.rb

Class Method Summary collapse

Class Method Details

.compatible_version?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
# File 'lib/puppet_x/puppetlabs/compatible_powershell_version.rb', line 7

def self.compatible_version?
  powershell_version = PuppetX::PuppetLabs::Dsc::PowerShellVersion.version

  return false if powershell_version.nil?

  # We require at least PowerShell v5, where Invoke-DscResource was first
  # introduced and most bug fixes are found.
  Gem::Version.new(powershell_version) >= Gem::Version.new(5)
end