Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generate a random string
- Function Get-RandomAlphanumericString {
- [CmdletBinding()]
- Param (
- [int] $length = 8
- )
- Begin{
- }
- Process{
- Write-Output ( -join ((0x30..0x39) + ( 0x41..0x5A) + ( 0x61..0x7A) | Get-Random -Count $length | % {[char]$_}) )
- }
- }
- param (
- [string]$username = "username",
- [string]$password = $( Get-RandomAlphanumericString -length 16 )
- )
- Write-Output "$password"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement