Welcome › Forums › General PowerShell Q&A › ConvertFrom-String (TemplateContent)
This topic contains 3 replies, has 4 voices, and was last updated by
I would like to extract the following data:
From the following string:
UserStateRunning IE:ProtectedMode Doc:ProtectedMode vSentry:Enabled
Currently Running Template:
I would like the text before the column to be the header and the text after the column to be the data.
I've tried numerous of different ways in my TemplateContent, but with no success.
Thanks in advance!
It would probably be helpful for people to see what you've tried. Everyone's happy to try and help, but asking for a from-scratch solution is often more time-heavy than folks are able to accommodate :).
This is a link to another post about Convert-FromString. It is a worthwhile command to learn and understand. I use it all the time to parse semi-structured text files.
If you can get it to break everything down into a series of lines (one item per line) then you can use ConvertFrom-StringData.
$InputData -replace '$(?< =[\w ]+):','=' | ConvertFrom-StringData
The topic ‘ConvertFrom-String (TemplateContent)’ is closed to new replies.