This just screams [Hashtable] however ConvertFromStringData is no use here, nor am I able to cast it… Can someone guide how I can convert this string to an array of hashtable or some other datatype that makes sense?
There’s not going to be a completely easy way out, here; you’ll have to do some parsing of that string yourself. It looks similar to PowerShell code, but there are enough differences that you can’t just get away with something like Invoke-Expression. (There’s no comma between the objects, and the values aren’t quoted.)
I would probably take the approach of parsing this string and converting it into a format that can be passed to ConvertFrom-StringData. This is safer than Invoke-Expression, in case the data that comes back is somewhat weird.
We’re splitting on the close curly brace, to more or less separate these as they should be. Then, stripping away the other characters until we’re left with a key-value pair (line one of my attachment), which is sent to ConvertFrom-StringData (line two).
You should be able to parameterize this snippet easily into your function to get back PowerShell objects from whatever you’re doing.
If you need to go further and separate out the other values, I’d just use a calculated property Select-Object @{Name=‘Column Heading’;Expression={#Code}} syntax to break them out, or make a Custom Object. Let me know if you’d like help with that.