Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Read the file into memory
$fileAsByteArray = [System.IO.File]::ReadAllBytes($FilePath);
$Base64String = [System.Convert]::ToBase64String($fileAsByteArray);
$Base64String | Out-File '.\a file'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment