Skip to content

Instantly share code, notes, and snippets.

@AshFlaw
Created June 28, 2018 11:25
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 AshFlaw/6cec295adcd500bb2705723622e70e1a to your computer and use it in GitHub Desktop.
Save AshFlaw/6cec295adcd500bb2705723622e70e1a to your computer and use it in GitHub Desktop.
A one line command to get a full (username and password) credential object without bringing them in from variables.
$Credential = New-Object System.Management.Automation.PSCredential 'username',(convertto-securestring 'password' -asplaintext -force)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment