Skip to content

Instantly share code, notes, and snippets.

@sarangbk
Created October 11, 2017 09:50
Show Gist options
  • Save sarangbk/ee35c25c4dd547908826a32d8ad7e54e to your computer and use it in GitHub Desktop.
Save sarangbk/ee35c25c4dd547908826a32d8ad7e54e to your computer and use it in GitHub Desktop.
Quick and dirty way to generate a random password as secure string for use in a PowerShell script
$Password= -join ((33..63) + (65..90) + (97..122) | Get-Random -Count 12 | % {[char]$_}) | ConvertTo-SecureString -AsPlainText -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment