Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Embedded Credentials in a PowerShell Script
$username = "bad.admin@acme.com.au"
$password = "Password123!@#"
$secureStringPwd = $password | ConvertTo-SecureString -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential -ArgumentList $user, $secureStringPwd
@yiannosven

This comment has been minimized.

Copy link

commented Jan 5, 2018

Hey Dave,
Thank you for this.
Just thinking, the $user variable in the last line should prolly be $username no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.