Skip to content

Instantly share code, notes, and snippets.

@peewpw
Created December 3, 2017 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save peewpw/4bbcce5b89e96d48f4495cd8cb95aab6 to your computer and use it in GitHub Desktop.
Save peewpw/4bbcce5b89e96d48f4495cd8cb95aab6 to your computer and use it in GitHub Desktop.
param (
[string]$in = $( Read-Host "Please specify a file to encode with -in" ),
[string]$out = $( Read-Host "Please specify an output file with -out" )
)
if (-Not (Test-Path $in)) { Read-Host "Please Specify a valid filepath" }
$str = [System.IO.File]::ReadAllText($in)
$bytes = [System.Text.Encoding]::Unicode.GetBytes($str)
[Convert]::ToBase64String($bytes) | Out-File $out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment