summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-25 12:56:04 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-08-25 12:56:04 -0700
commitf4537fbe80f075f6c83d801c0b60729b630a21af (patch)
tree0ca7301fc9965516474e5517f7331caf83c92c81 /lib/chef
parent4d7684afbbb049a92b35fc958b6528b1949acee3 (diff)
parent5b4c9b5ba2de80fa0e61335b07c51b4b19571a43 (diff)
downloadchef-f4537fbe80f075f6c83d801c0b60729b630a21af.tar.gz
Merge pull request #3772 from chef/jdm/dsc-script-ps-cred
Add ps_credential dsl method to dsc_script
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/resource/dsc_script.rb2
-rw-r--r--lib/chef/util/powershell/ps_credential.rb4
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index 2877f61eb4..c3602fa60e 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -17,10 +17,12 @@
#
require 'chef/exceptions'
+require 'chef/dsl/powershell'
class Chef
class Resource
class DscScript < Chef::Resource
+ include Chef::DSL::Powershell
provides :dsc_script, os: "windows"
diff --git a/lib/chef/util/powershell/ps_credential.rb b/lib/chef/util/powershell/ps_credential.rb
index 01f8c27b6c..3f4558a77c 100644
--- a/lib/chef/util/powershell/ps_credential.rb
+++ b/lib/chef/util/powershell/ps_credential.rb
@@ -29,6 +29,10 @@ class Chef::Util::Powershell
"New-Object System.Management.Automation.PSCredential('#{@username}',('#{encrypt(@password)}' | ConvertTo-SecureString))"
end
+ def to_s
+ to_psobject
+ end
+
private
def encrypt(str)