|
|
|
|
|
by majkinetor
713 days ago
|
|
Not only its built in, but syntax is on another level, i.e. you don't need to learn special syntax if you know PowerShell. This thing alone makes pwsh worth it instead of using number of other tools. @{ Hello = 'world'; array = 1..10; object = @{ date = Get-Date } } | ConvertTo-Json
{
"array": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"object": {
"date": "2024-07-03T21:07:21.6562053+02:00"
},
"Hello": "world"
}
|
|
For good measure, this is how you might do the same with jb:
Alternatively, using the :{} object entry syntax: