There is a hidden gem in the .NET System.Web assembly which lets you create random passwords of any length in no time:
# total password length $Length = 10 # number of non-alpha-chars $NonChar = 3 Add-Type -AssemblyName 'System.Web' $password = [System.Web.Security.Membership]::GeneratePassword($Length,$NonChar) "Your password: $password"