|
param(
|
|
[Parameter(Mandatory)]
|
|
[int]$Length,
|
|
[string]$AllowedChars="ABCDEFGHIJKLMNOPQVRSTUWXYZabcdefghijklmnopqvrstuwxyz0123456789"
|
|
)
|
|
1..$Length | ForEach-Object {
|
|
$AllowedChars[$([math]::Round($(Get-Random -Minimum 0 -Maximum ($AllowedChars.Length)),0))]
|
|
} | Join-String |