Reputation: 43193
Suppose I have a foo.exe console app that returns some json, and I want to turn that into a PowerShell object.
I was hoping to simply write:
$o = foo.exe | ConvertFrom-Json
But this doesn't work because the output of the console app is treated as an Array instead of a string. I can instead write:
$o = ([string]foo.exe) | ConvertFrom-Json
which feels dirtier than I was hoping.
Question: can I do better than what I have above to get a PowerShell object out of the output of a console app?
Upvotes: 2
Views: 627