Functions/Data/Get-RandomCharacter.ps1
Function Get-RandomCharacter { [cmdletbinding()] Param ( [Parameter(Mandatory=$false)] [int] $Count = 1, [Parameter(Mandatory=$false)] [ValidateSet("Alphanumeric")] [String] $Set = "Alphanumeric" ) Process { $Range = Switch($Set) { "Alphanumeric" {(48..57)+(65..90) + (97..122)} } $Range | Get-Random -Count $Count | % {[char]$_} } } |