Skip to content

Commit 7feac5c

Browse files
authored
Document AsStream parameter
1 parent d836460 commit 7feac5c

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Json.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,24 @@ Converts an object to a JSON-formatted string.
1515

1616
## SYNTAX
1717

18+
### Default (Default)
1819
```
1920
ConvertTo-Json [-InputObject] <Object> [-Depth <Int32>] [-Compress]
20-
[-EnumsAsStrings] [-AsArray] [-EscapeHandling <StringEscapeHandling>]
21+
[-EnumsAsStrings] [-EscapeHandling <StringEscapeHandling>]
22+
[<CommonParameters>]
23+
```
24+
25+
### Array
26+
```
27+
ConvertTo-Json [-InputObject] <Object> -AsArray [-Depth <Int32>] [-Compress]
28+
[-EnumsAsStrings] [-EscapeHandling <StringEscapeHandling>]
29+
[<CommonParameters>]
30+
```
31+
32+
### Stream
33+
```
34+
ConvertTo-Json [-InputObject] <Object> -AsStream [-Depth <Int32>] [-Compress]
35+
[-EnumsAsStrings] [-EscapeHandling <StringEscapeHandling>]
2136
[<CommonParameters>]
2237
```
2338

@@ -180,7 +195,23 @@ Outputs the object in array brackets, even if the input is a single object.
180195

181196
```yaml
182197
Type: System.Management.Automation.SwitchParameter
183-
Parameter Sets: (All)
198+
Parameter Sets: Array
199+
Aliases:
200+
201+
Required: False
202+
Position: Named
203+
Default value: None
204+
Accept pipeline input: False
205+
Accept wildcard characters: False
206+
```
207+
208+
### -AsStream
209+
210+
Converts each input object to a complete JSON string.
211+
212+
```yaml
213+
Type: System.Management.Automation.SwitchParameter
214+
Parameter Sets: Stream
184215
Aliases:
185216

186217
Required: False
@@ -304,7 +335,8 @@ You can pipe any object to this cmdlet.
304335

305336
### System.String
306337

307-
This cmdlet returns a string representing the input object converted to a JSON string.
338+
This cmdlet returns a string representing the input object(s) converted to a JSON string.
339+
When AsStream is specified, each object is converted to a complete JSON string.
308340

309341
## NOTES
310342

0 commit comments

Comments
 (0)