Skip to content

Instantly share code, notes, and snippets.

@nightroman
Created March 29, 2015 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nightroman/cec4cdf0e7a5146c40e7 to your computer and use it in GitHub Desktop.
Save nightroman/cec4cdf0e7a5146c40e7 to your computer and use it in GitHub Desktop.
Get, export, and import credential
# credential file path
$CredentialPath = "$PSScriptRoot\credential.clixml"
# get and export credential
$credential = Get-Credential
$credential | Export-Clixml -LiteralPath $CredentialPath
# import credential
$credential = Import-Clixml -LiteralPath $CredentialPath
$credential
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment