Skip to content

Instantly share code, notes, and snippets.

@larsks
Created November 4, 2012 13:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsks/4011878 to your computer and use it in GitHub Desktop.
Save larsks/4011878 to your computer and use it in GitHub Desktop.
Generating a random password using GeneratePassword
Function New-RandomComplexPassword ($length=8)
{
$Assembly = Add-Type -AssemblyName System.Web
$password = [System.Web.Security.Membership]::GeneratePassword($length,2)
return $password
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment