Skip to content

Instantly share code, notes, and snippets.

@am1ru1
Forked from nightroman/Credential.ps1
Created September 7, 2016 07:50
Show Gist options
  • Save am1ru1/e54abc12edfb56f21b08a0ab122a0d7c to your computer and use it in GitHub Desktop.
Save am1ru1/e54abc12edfb56f21b08a0ab122a0d7c 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