Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1..2 | % { [PSCustomObject] @{
- 1 = Get-Random
- 2 = Get-Random
- 3 = ([PSCustomObject] @{ 4 = Get-Random; 5 = Get-Random }) | ConvertTo-Json
- } } | Export-Csv -NoTypeInformation c:\temp\csvjson.csv
- cat $$
- $a = Import-Csv $$
- $results = $a | % {
- $output = $_
- $3 = $_.3 | ConvertFrom-Json
- $3.PSObject.Properties | % {
- $output = $output | Add-Member $_.Name $_.Value -Pass
- }
- $output
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement