summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-02-29 12:53:55 -0800
committerMatt Wrock <matt@mattwrock.com>2016-02-29 14:33:05 -0800
commitb096f5d1c01ca4562b63ea1b088c9cd4d22f501f (patch)
tree1c9de7397b0887c59349eaa10f70b65cedb518b3 /lib/chef
parent5533dbb2917860dca16765d49079ed01a421fad8 (diff)
downloadchef-b096f5d1c01ca4562b63ea1b088c9cd4d22f501f.tar.gz
if no module name is found for a valid dsc resource default to PSDesiredStateConfigurationdsc
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/dsc_resource.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb
index be752f269f..0f25065925 100644
--- a/lib/chef/provider/dsc_resource.rb
+++ b/lib/chef/provider/dsc_resource.rb
@@ -110,7 +110,7 @@ class Chef
"sure that it shows up when running Get-DscResource"
when 1
if found[0]["Module"].nil?
- :none
+ "PSDesiredStateConfiguration" # default DSC module
else
found[0]["Module"]["Name"]
end
@@ -151,10 +151,7 @@ class Chef
def invoke_resource(method, output_format = :object)
properties = translate_type(@new_resource.properties)
switches = "-Method #{method} -Name #{@new_resource.resource}"\
- " -Property #{properties} -Verbose"
- if module_name != :none
- switches += " -Module #{module_name}"
- end
+ " -Property #{properties} -Module #{module_name} -Verbose"
cmdlet = Chef::Util::Powershell::Cmdlet.new(
node,
"Invoke-DscResource #{switches}",