Create Random Passwords

by Dec 13, 2010

Whenever you need to create a new random password, be sure to check out this function:

function Get-RandomPassword {
$length = 10,
$characters =
# select random characters
$random = 1..$length | ForEach-Object { Get-Random -Maximum $characters.length }
# output random pwd

You can specify the length and submit a pool of characters that your password could contain. By default, the function will use characters, numbers, and special characters and will avoid characters like "o" and "0" that could be misinterpreted.

Twitter This Tip!
ReTweet this Tip!