Last active
August 3, 2022 20:20
-
-
Save janikvonrotz/f437d7764a43b9de6c3a to your computer and use it in GitHub Desktop.
PowerShell: Get Random Password
#PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-RandomPassword{ | |
$numbers = 1..9 | |
$consonants = "b","c","d","f","g","h","k","l","m","n","p","r","s","t","v","w","x","z" | |
$nopeletters = "j","q","y" | |
$vocals = "a","e","i","o","u" | |
$dotsandstuff = ",",".","-" | |
$nopedotsandstuff = ";",":","_" | |
return (Get-Random $consonants).ToString().ToUpper() + | |
(Get-Random $vocals) + | |
(Get-Random $consonants) + | |
(Get-Random $vocals) + | |
(Get-Random $consonants) + | |
(Get-Random $vocals) + | |
(Get-Random $numbers) + | |
(Get-Random $numbers) + | |
(Get-Random $numbers) + | |
(Get-Random $dotsandstuff) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment