Class: Chef::Util::Powershell::PSCredential
- Inherits:
-
Object
- Object
- Chef::Util::Powershell::PSCredential
- Defined in:
- lib/chef/util/powershell/ps_credential.rb
Instance Method Summary collapse
-
#initialize(username, password) ⇒ PSCredential
constructor
A new instance of PSCredential.
- #to_psobject ⇒ Object (also: #to_s, #to_text)
Constructor Details
#initialize(username, password) ⇒ PSCredential
Returns a new instance of PSCredential.
25 26 27 28 |
# File 'lib/chef/util/powershell/ps_credential.rb', line 25 def initialize(username, password) @username = username @password = password end |
Instance Method Details
#to_psobject ⇒ Object Also known as: to_s, to_text
30 31 32 |
# File 'lib/chef/util/powershell/ps_credential.rb', line 30 def to_psobject "New-Object System.Management.Automation.PSCredential('#{@username}',('#{encrypt(@password)}' | ConvertTo-SecureString))" end |