All too often I find myself on a Windows system and need to either encode or decode base64. Rather than using an online service, installing a program, or going to a *nix based system, I took to PowerShell. In PowerShell, we can use .NET to accomplish this. Encoding:
1 2 3 4 |
$Text2Encode = ‘PowerShell is Great!’ $Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text2Encode) $EncodedText =[Convert]::ToBase64String($Bytes) $EncodedText |
The