fix: Windows PowerShell 5.1 start_docker crash and paste-safe docs snippets

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abhishek Kumar 2026-07-01 15:54:11 +05:30
parent a850d18767
commit dc98298b66
5 changed files with 12 additions and 17 deletions

View file

@ -7,7 +7,12 @@ $Utf8NoBom = [System.Text.UTF8Encoding]::new($false)
function New-HexSecret {
$bytes = [byte[]]::new(32)
[System.Security.Cryptography.RandomNumberGenerator]::Fill($bytes)
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
try {
$rng.GetBytes($bytes)
} finally {
$rng.Dispose()
}
return -join ($bytes | ForEach-Object { $_.ToString('x2') })
}