0

Can PowerShell script remove all tags and texts in XML file and keep only binary data ? Tags and texts in tags block me to decript binary code.

<message id="3" date="2010">
<text>4+Cj4+CmVuZG9iagoyIDAgb...</text></message>

Need remove all and keep clear binary code and re-saved file.

4+Cj4+CmVuZG9iagoyIDAgb...

Is even possible do this in PowerShell?

1 Answer 1

1

PowerShell loves XML. If you just import your data to a a variable cast as XML, you don't have to do regex stuff. You can use Get-Content or just copy/paste like this:

[xml]$MyData = '<message id="3" date="2010"><text>4+Cj4+CmVuZG9iagoyIDAgb...</text></message>'
$MyData.message.text
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.