Generate a cryptographically random Base64 password in PowerShell
Build a paste-ready command, then review its compatibility and effects before running it.
[Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(<count>))Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
PowerShell 7+Uses the static RandomNumberGenerator.GetBytes(Int32) overload available with modern .NET.
Operational knowledgereview due 2027-01-19
Requirementsshellshell must be installed and available on PATH.
Version supportshell Current supported releasesVerified for windows using powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalseP+uJom70y/P6lPwBqKZ0qbrk/NTzvGgRepresentative successful output; values vary with the selected target and system state.
Known errorsshell: command not foundshell is missing or is not available on PATH.
Verify[Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes({{count}}))The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01[Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(<count>))CommandRuns the [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(<count>)) stage of this one-liner.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
[Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
Example output
eP+uJom70y/P6lPwBqKZ0qbrk/NTzvGg
Illustrative output — exact values vary by system and data.
Official sources