Skip to content

Files

Latest commit

 

History

History
25 lines (17 loc) · 751 Bytes

decode-string-from-base64.md

File metadata and controls

25 lines (17 loc) · 751 Bytes

Decode String From Base64

This article provides a nice breakdown for the process of decoding Base64 to a string. It also gives a clean way to setup a function in your PowerShell profile to handle this task. You have options for the type of string encoding such as Unicode, UTF-8, UTF-7, or ASCII.

[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($EncodedText))

or

[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($EncodedText))

or

[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($EncodedText))

Example

References