Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Last active July 11, 2016 08:42
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 jacoelho/9abb387ec8865d926b37 to your computer and use it in GitHub Desktop.
Save jacoelho/9abb387ec8865d926b37 to your computer and use it in GitHub Desktop.
Function Create-RandomPassword {
$Length = "10" #number of characters
$NonAlpha = "2" #Number of non alphanumerical characters
[Reflection.Assembly]::LoadWithPartialName(“System.Web”) | Out-Null
[System.Web.Security.Membership]::GeneratePassword($Length,$NonAlpha)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment