0
Good morning I’m trying to convert a base string 64
$b = ((New-Object System.Net.WebClient).DownloadString("domain/file")
$c = [System.Convert]::FromBase64String($b)
but give me the error
Exception calling "FromBase64String" with "1" argument(s): "A entrada não é uma cadeia de Base-64 válida dado que contém um caráter que não é de base 64, mais de dois carateres de preenchimento ou um caráter ilegal entre os carateres de preenchimento. " At line:1 char:1 + $c = [System.Convert]::FromBase64String($b) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FormatException
What could I be doing wrong?
Thank you
I did the test here and did not generate this exception, I believe the problem is present in the contents of variable $b.
– Daniel Mendes
the content you used was a PE or a bin?
– ampf27
It was a local string that I myself declared with Base64 content.
– Daniel Mendes
I tried to replace PE with PE in Base64 nor txt format but still does not give
– ampf27
The problem is with the data you are trying to convert from
base64
for binary. Could attach the question.– Augusto Vasques