Skip to content

Instantly share code, notes, and snippets.

@mattwoolnough
Last active August 9, 2017 01:53
Show Gist options
  • Save mattwoolnough/4851607e5e496d7e472c677d40a1cd02 to your computer and use it in GitHub Desktop.
Save mattwoolnough/4851607e5e496d7e472c677d40a1cd02 to your computer and use it in GitHub Desktop.
Base 64 Unix to Win
*nix b64 encode binary file
base64 -i ~/Downloads/site.lic
Windows 64 encode binary file
$FileName = "C:\site.lic"
$base64string = [Convert]::ToBase64String([IO.File]::ReadAllBytes($FileName))
$base64string | Out-File "c:\lic.b64.txt"
Windows Decode b64 encoded file
$data = gc .\lic.b64.txt
$bytes = [Convert]::FromBase64String($data)
[IO.File]::WriteAllBytes("C:\Users\admin\Documents\site.lic" ,$bytes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment