ConvertTo-JSON an array with a single item

Try without the pipeline:

PS C:\> ConvertTo-Json @('one', 'two')
[
    "one",
    "two"
]
PS C:\> ConvertTo-Json @('one')
[
    "one"
]

Leave a Comment