Base 64 very useful, but limited on PowerShell cause of max string length 8191chars.
By checking md5sum we can check if successfull
First we check md5sum
md5sum id_rsa
Base 64 encode and print it to console:
cat id_rsa |base64 -w 0;echoOn the Windows PS we can now paste the output in and write those bytes:
[IO.File]::WriteAllBytes(“C:\Users\Public\id_rsa”, [Convert]::FromBase64String(“LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBJuTnphQzFFYm05dVpRQUFBQUFBQUFBQkFBQUFsd0FBQUQo=”))
And now we can confirm the md5-hash on PowerShell:
Get-FileHash C:\Users\Public\id_rsa -Algorithm md5