Skip to content

Instantly share code, notes, and snippets.

@damienpontifex
Last active August 26, 2018 07:16
Show Gist options
  • Save damienpontifex/2dd36c2b21fc97b358802c3a5ba15d35 to your computer and use it in GitHub Desktop.
Save damienpontifex/2dd36c2b21fc97b358802c3a5ba15d35 to your computer and use it in GitHub Desktop.
Function Get-RandomPassword
{
Param(
[Int]
$PasswordLength = 32
)
$allChars = [char[]](33..126)
$password = (Get-Random -InputObject $allChars -Count $PasswordLength) -join ''
return $password
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment