TXT2BIN and BIN2TXT (Base64)
# bin to text
$bytes = [System.IO.File]::ReadAllBytes('C:\temp\file.zip')
$txt = [System.Convert]::ToBase64String($bytes)
[System.IO.File]::WriteAllText('C:\temp\zip.txt', $txt)
Β
# text to bin
$tt = [System.IO.File]::ReadAllText('C:\temp\zip.txt')
$bb = [System.Convert]::FromBase64String($tt)
[System.IO.File]::WriteAllBytes('C:\temp\txt.zip', $bb)
Comments