I had an andoid SMS backup in XML format, that I has split each element into a base64 encoded file, 1 per image. I used this to convert the file into a jpeg.
#Convert base64 encoded files into images
#used for pulling data out of android sms backups
$fileToDecode=get-content "base64.file"
$bytes=[convert]::FromBase64String($fileToDecode)
[io.file]::WriteAllBytes("output.jpeg",$bytes)