Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Created June 27, 2017 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/d25079fc016ea752af5ed1c2e4bd0080 to your computer and use it in GitHub Desktop.
Save techthoughts2/d25079fc016ea752af5ed1c2e4bd0080 to your computer and use it in GitHub Desktop.
Create a secure credential object
$PASSWORD = 'password'
$user = "domain\user"
$secureString = ConvertTo-SecureString -AsPlainText -Force -String $PASSWORD
$credential = New-Object `
-TypeName System.Management.Automation.PSCredential `
-ArgumentList $user,$secureString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment