akhi07rx

2 min read

Generating Google Style Passwords in PowerShell


Didn’t need this. IK!

Google style passwords have a pretty specific pattern mixed case, one symbol, no ambiguous characters like 0/O or l/1. A PowerShell one liner can duplicate that.

-join ((Get-Random -InputObject (65..90+97..122+50..57) -Count 12) + (Get-Random -InputObject (33,35,36,37,38,42,64) -Count 1) | ForEach-Object {[char]$_} | Sort-Object {Get-Random})

It pulls 12 characters from the letter and digit ranges, grabs one symbol separately, then shuffles everything. The number ranges are just ASCII — 65..90 is uppercase, 97..122 is lowercase, 50..57 is digits 2-9 (skips 0 and 1). Spits out something like q7Rz$maL2Kx9T.

Simpler version:

-join ((65..90+97..122+48..57+@(33,64,35,36,37)) | Get-Random -Count 14 | ForEach-Object {[char]$_})

Less fussy, 14 characters.