Skip to main content

22 posts tagged with "PowerShell"

View All Tags

Handling Base64 encoded strings with PowerShell

· One min read

I don't handle Base64 strings very often - when I do I find myself searching for instructions every time. So I finally decided to add two small helper functions to my PowerShell profile.

PROFILE.ps1
function ConvertFrom-Base64String ([String]$InputString, [System.Text.Encoding]$Encoding) {
$DecodedString = $Encoding.GetString([System.Convert]::FromBase64String($InputString))
$DecodedString
}

function ConvertTo-Base64String ([String]$InputString, [System.Text.Encoding]$Encoding) {
$StringBytes = $Encoding.GetBytes($InputString)
$EncodedString = [System.Convert]::ToBase64String($StringBytes)
$EncodedString
}
tip

You can quickly edit your PowerShell profile file by typing code $PROFILE into your PowerShell window - this will pop up VS Code with your profile ready to edit.

Monitoring OneDrive status with PowerShell, CyberDrain and NinjaOne

· 4 min read

This post uses code from CyberDrain

Click the link below to check out the original post on CyberDrain.com and support Kelvin's fantastic work for the MSP community.

About this script

So firstly, if you haven't already, hit the giant orange button above to read the original blog post on CyberDrain.com to understand what this script is doing!