Created
July 9, 2019 09:47
-
-
Save giseongeom/162679f1b71124b50aed03301c877cbf to your computer and use it in GitHub Desktop.
Create PSCredential object using cleartext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-PSCredential([string]$User, [string]$Pass) { | |
| $username = $User | |
| $password = ConvertTo-SecureString $Pass -AsPlainText -Force | |
| $psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password) | |
| return $psCred | |
| } |
Author
giseongeom
commented
Jul 9, 2019
- Usage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment