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.
23 24 25 26 |
# File 'lib/chef/util/powershell/ps_credential.rb', line 23 def initialize(username, password) @username = username @password = password end |
Instance Method Details
#to_psobject ⇒ Object Also known as: to_s, to_text
28 29 30 |
# 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 |