Posted On March 31, 2019

PowerShell RandomPassword Function

kimconnect 0 comments
blog.KimConnect.com >> Codes , Windows >> PowerShell RandomPassword Function
function randomPassword{

   # return a reasonably randomized password that starts with "KimConnect:" plus 25 characters with some complexities

   $append="KimConnect:";

    $script:salt = ([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..8 | sort {Get-Random})[0..24] -join '';

    return "$append$salt";

    }

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Hobocopy Backup Software

# hobocopy-backup.ps1# Note: this is a quick snippet to demonstrate the use of this utility.#…

Reset Windows Update Tool

:: ==================================================================================:: Re-posting this here because I admire the good work by Sir Manuel Gil::…

Install and Remove Choco Applications As Well As Application Wizard Programs

# installChocoApps.ps1 [string[]]$computers=@( 'SERVER01', 'SERVER02', 'SERVER03' ) [string]$chocoAppName='pgadmin4' [version]$minVersion='6.0' function installChocoApp{ param( [string[]]$computers=$env:computername, [string]$chocoAppName='Firefox', [version]$minVersion='7.0'…