Last active
May 19, 2016 15:56
-
-
Save davidroberts63/a55cb9bfe9052f523a7410b4a16e56cd to your computer and use it in GitHub Desktop.
Converts a file to Base64 encoding. Useful for images you want to use in HTML. Just take the contents of the resulting .b64 file and put it in your image tag or CSS.
This file contains hidden or 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
$fileName = "C:\Temp\SomeImage.png" | |
[Convert]::ToBase64String((Get-Content $fileName -Encoding Byte)) | Set-Content ($fileName + ".b64") -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment