Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # I know I know... The veriables for Read-Host should be be parameters... but
- # that's for another day. At least it errors out when someone types a char instead
- $chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+=-'
- [int]$numberPassword = Read-Host -Prompt 'How many passwords?'
- [int]$lengthPassword = Read-Host -Prompt "Length of passwords?"
- for ($i = 0; $i -lt $numberPassword; $i++) {
- $pw = Get-Random -InputObject $chars.ToCharArray() -Count $lengthPassword
- $finalPassword = -join $pw
- Write-Output $finalPassword
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement