class Chef::Util::Powershell::PSCredential
Public Class Methods
new(username, password)
click to toggle source
# File lib/chef/util/powershell/ps_credential.rb, line 23 def initialize(username, password) @username = username @password = password end
Public Instance Methods
to_psobject()
click to toggle source
# File lib/chef/util/powershell/ps_credential.rb, line 28 def to_psobject "New-Object System.Management.Automation.PSCredential('#{@username}',('#{encrypt(@password)}' | ConvertTo-SecureString))" end
Private Instance Methods
encrypt(str)
click to toggle source
# File lib/chef/util/powershell/ps_credential.rb, line 37 def encrypt(str) Chef::ReservedNames::Win32::Crypto.encrypt(str) end