Skip to content

Instantly share code, notes, and snippets.

@loctanvo
Created October 4, 2019 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loctanvo/a0967e67aab50f6d67c6603b8279278e to your computer and use it in GitHub Desktop.
Save loctanvo/a0967e67aab50f6d67c6603b8279278e to your computer and use it in GitHub Desktop.
function New-GeneratedPwd {
$bytes = New-Object "System.Byte[]" 32
$rnd = New-Object System.Security.Cryptography.RNGCryptoServiceProvider
$rnd.GetBytes($bytes)
[Convert]::ToBase64String($bytes)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment