3 ms·
Come on now, you're missing the point. If the lingua franca of your shell is objects instead of text, you can import from whatever format you want and work wit
by 13of40 10y ago
Come on now, you're missing the point. If the lingua franca of your shell is objects instead of text, you can import from whatever format you want and work with it in high fidelity:
PS C:\> $x = [XML]"<banana><stem>brown</stem><peel>yellow</peel><flesh>white</flesh></banana>"
PS C:\> $x.banana.peel
yellow
PS C:\> $x = ConvertFrom-Json -InputObject '[{"banana" : {"stem" : "brown", "peel" : "yellow", "flesh" : "white"}}]'
PS C:\> $x.banana.peel
yellow
PS C:\> $x = New-Object PSObject -Property @{banana = New-Object PSObject -Property @{stem = "brown"; peel = "yellow"; flesh = "white"}}
PS C:\> $x.banana.peel
yellow
PS C:\> $x = @{banana = @{stem = "brown"; peel = "yellow"; flesh = "white"}}
PS C:\> $x.banana.peel
yellow
- fabianfabian 10y agoGood point, thanks for clarifying.