Certified Security - Specialty

Sign Up Free or Log In to participate!

Base64 conversion option not working in powershell

Has anyone had a problem running the get-credential-report in powershell? I cannot get the base64 conversion option to work.  This is the message I get (I did try upper and lower case B for Base64):

base64 : The term ‘base64’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:63

  • … s iam get-credential-report –output text –query Content | base64 -d

  • CategoryInfo : ObjectNotFound: (base64:String) [], CommandNotFoundException

  • FullyQualifiedErrorId : CommandNotFoundException

3 Answers

You could take the base64 output and then perform the following:

$EncodedText = “VABoAGkAcwAgAGkAcwAgAGEAIABzAGUAYwByAGUAdAAgAGEAbgBkACAAcwBoAG8AdQBsAGQAIABiAGUAIABoAGkAZABlAG4A”

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

$DecodedText

I changed the base64 -D in the script to lower case -d and issue is fixed.  Hope this helps!

Al Or

that fixed the error. Thanks!

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?