diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-02 21:14:56 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:02 -0700 |
commit | 60e93f358f30ad229e7a31e8c92a49687e0bf858 (patch) | |
tree | 0798510da9ad73a5f487ac1fa794c4b3827a3edd /lib/chef/platform | |
parent | 46a573da4409adaa3249fda6e3e75380523c78f8 (diff) | |
download | chef-60e93f358f30ad229e7a31e8c92a49687e0bf858.tar.gz |
Added function to check if Invoke-DscResource is supported
Invoke-DscResource was introduced in Powershell 5.0.10018.0
Diffstat (limited to 'lib/chef/platform')
-rw-r--r-- | lib/chef/platform/query_helpers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb index ff83c871fa..f7c85fbe23 100644 --- a/lib/chef/platform/query_helpers.rb +++ b/lib/chef/platform/query_helpers.rb @@ -47,6 +47,13 @@ class Chef node[:languages] && node[:languages][:powershell] && node[:languages][:powershell][:version].to_i >= 4 end + + def supports_dsc_invoke_resource?(node) + require 'rubygems' + supports_dsc?(node) && + Gem::Version.new(node[:languages][:powershell][:version]) >= + Gem::Version.new("5.0.10018.0") + end end end end |