Created
December 3, 2017 23:58
-
-
Save peewpw/4bbcce5b89e96d48f4495cd8cb95aab6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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