Home One line passphrase
Post
Cancel

One line passphrase

Passwords are something we often don’t think enough about. It’s common to reuse them or to write them down in places that aren’t as secure (hello sticky note under the keyboard). This post is definetly NOT about a secure password, but, in a pinch it is better than writing “Welcome123”.

The Get-Verb command in Powershell lists all the approved verbs that be used in Powershell. By piping the output directly into Get-Random we can select any number of them at random. If we combine that with some simple logic to get random special characters and numbers we arrive at a oneliner that can generate passwords that are acceptable for most services password requirements.

Most passphrase generators use wordlists containing 7K-10K words. Get-Verb contains 98 words. Do not use this example in production.

1
(((Get-Verb | Get-Random -Count 3).Verb) + (('+-*=@$^%_&#?>/').ToCharArray() | Get-Random -Count 1) + (('0123456789').ToCharArray() | Get-Random -Count 1)) -Join ""
This post is licensed under CC BY 4.0 by the author.