Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generates Passphrases
- # Stolen from http://www.hanselman.com/blog/DictionaryPasswordGeneratorInPowershell.aspx
- #
- $rand = new-object System.Random
- $conjunction = "The","My","We","Our","And","But","For","So","Not","To","Any"
- $special = "%","*","+","&","."
- $number = "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"
- $separator = ",","-","_","."
- $words = Get-Content '\\mbrnysmith01\it_folders\TOOLS\Scripts\wordlist.txt'
- for ($ii = 1; $ii -le 30; $ii++){
- $word1 = ($words[$rand.Next(0,$words.Count)])
- $con = ($conjunction[$rand.Next(0,$conjunction.Count)])
- $word2 = ($words[$rand.Next(0,$words.Count)])
- $num = ($number[$rand.Next(0,$number.Count)])
- $sep1 = ($separator[$rand.Next(0,$separator.Count)])
- $sep2 = ($separator[$rand.Next(0,$separator.Count)])
- $sc = ($special[$rand.Next(0,$special.Count)])
- #return $word1 + " " + $con + " " + $word2
- $result = $word1 + $sep1 + $con + $sep1 + $word2 + $sc + $num
- Write-Host $result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement