Powershell base64

How to encode and decode on Powershell

One line encoder and decoder in powershell

Encode

[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("SecretMessage"))

Decode

[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("U2VjcmV0TWVzc2FnZQ=="))