@@ -32,7 +32,8 @@ The `Invoke-RestMethod` cmdlet sends HTTP and HTTPS requests to Representational
32
32
33
33
PowerShell formats the response based to the data type. For an RSS or ATOM feed, PowerShell returns
34
34
the Item or Entry XML nodes. For JavaScript Object Notation (JSON) or XML, PowerShell converts, or
35
- deserializes, the content into ` [PSCustomObject] ` objects.
35
+ deserializes, the content into ` [PSCustomObject] ` objects. Comments aren't permitted in the JSON
36
+ data.
36
37
37
38
> [ !NOTE]
38
39
> When the REST endpoint returns multiple objects, the objects are received as an array. If you pipe
@@ -205,11 +206,11 @@ Accept wildcard characters: False
205
206
206
207
### -Certificate
207
208
208
- Specifies the client certificate that is used for a secure web request. Enter a variable that
209
+ Specifies the client certificate that's used for a secure web request. Enter a variable that
209
210
contains a certificate or a command or expression that gets the certificate.
210
211
211
212
To find a certificate, use ` Get-PfxCertificate` or use the `Get-ChildItem` cmdlet in the Certificate
212
- (`Cert:`) drive. If the certificate is not valid or does not have sufficient authority, the command
213
+ (`Cert:`) drive. If the certificate isn't valid or doesn't have sufficient authority, the command
213
214
fails.
214
215
215
216
` ` ` yaml
@@ -252,7 +253,7 @@ Accept wildcard characters: False
252
253
Specifies the content type of the web request.
253
254
254
255
If this parameter is omitted and the request method is POST, `Invoke-RestMethod` sets the content
255
- type to " application/x-www-form-urlencoded" . Otherwise, the content type is not specified in the
256
+ type to ` application/x-www-form-urlencoded` . Otherwise, the content type isn't specified in the
256
257
call.
257
258
258
259
` ` ` yaml
@@ -305,7 +306,7 @@ Aliases:
305
306
306
307
Required: False
307
308
Position: Named
308
- Default value: KeepAlive
309
+ Default value: False
309
310
Accept pipeline input: False
310
311
Accept wildcard characters: False
311
312
` ` `
@@ -453,14 +454,14 @@ Accept wildcard characters: False
453
454
454
455
# ## -ProxyCredential
455
456
456
- Specifies a user account that has permission to use the proxy server that is specified by the
457
+ Specifies a user account that has permission to use the proxy server that's specified by the
457
458
**Proxy** parameter. The default is the current user.
458
459
459
- Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as
460
- one generated by the `Get-Credential` cmdlet.
460
+ Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such
461
+ as one generated by the `Get-Credential` cmdlet.
461
462
462
- This parameter is valid only when the **Proxy** parameter is also used in the command. You cannot
463
- use the **ProxyCredential** and **ProxyUseDefaultCredentials** parameters in the same command.
463
+ This parameter is valid only when the **Proxy** parameter is also used in the command. You can't use
464
+ the **ProxyCredential** and **ProxyUseDefaultCredentials** parameters in the same command.
464
465
465
466
` ` ` yaml
466
467
Type: System.Management.Automation.PSCredential
@@ -479,8 +480,8 @@ Accept wildcard characters: False
479
480
Uses the credentials of the current user to access the proxy server that is specified by the
480
481
**Proxy** parameter.
481
482
482
- This parameter is valid only when the **Proxy** parameter is also used in the command. You cannot
483
- use the **ProxyCredential** and **ProxyUseDefaultCredentials** parameters in the same command.
483
+ This parameter is valid only when the **Proxy** parameter is also used in the command. You can't use
484
+ the **ProxyCredential** and **ProxyUseDefaultCredentials** parameters in the same command.
484
485
485
486
` ` ` yaml
486
487
Type: System.Management.Automation.SwitchParameter
@@ -576,7 +577,7 @@ Accept wildcard characters: False
576
577
577
578
# ## -Uri
578
579
579
- Specifies the Uniform Resource Identifier (URI) of the Internet resource to which the web request is
580
+ Specifies the Uniform Resource Identifier (URI) of the internet resource to which the web request is
580
581
sent. This parameter supports HTTP, HTTPS, FTP, and FILE values.
581
582
582
583
This parameter is required. The parameter name (**Uri**) is optional.
@@ -630,12 +631,13 @@ Accept wildcard characters: False
630
631
631
632
Specifies a user agent string for the web request.
632
633
633
- The default user agent is similar to "Mozilla/5.0 (Windows NT; Windows NT 6.1; en-US)
634
- WindowsPowerShell/3.0" with slight variations for each operating system and platform.
634
+ The default user agent is similar to
635
+ ` Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.15063; en-US) PowerShell/6.0.0` with slight
636
+ variations for each operating system and platform.
635
637
636
- To test a website with the standard user agent string that is used by most Internet browsers, use
637
- the properties of the [PSUserAgent](/dotnet/api/microsoft.powershell.commands ) class, such as
638
- Chrome, Firefox, Internet Explorer , Opera, and Safari.
638
+ To test a website with the standard user agent string that's used by most internet browsers, use
639
+ the properties of the [PSUserAgent](xref:Microsoft.PowerShell.Commands.PSUserAgent ) class, such as
640
+ Chrome, Firefox, InternetExplorer , Opera, and Safari.
639
641
640
642
` ` ` yaml
641
643
Type: System.String
@@ -656,17 +658,17 @@ Specifies a web request session. Enter the variable name, including the dollar s
656
658
To override a value in the web request session, use a cmdlet parameter, such as **UserAgent** or
657
659
**Credential**. Parameter values take precedence over values in the web request session.
658
660
659
- Unlike a remote session, the web request session is not a persistent connection. It is an object
660
- that contains information about the connection and the request, including cookies, credentials, the
661
+ Unlike a remote session, the web request session isn't a persistent connection. It's an object that
662
+ contains information about the connection and the request, including cookies, credentials, the
661
663
maximum redirection value, and the user agent string. You can use it to share state and data among
662
664
web requests.
663
665
664
- To create a web request session, enter a variable name ( without a dollar sign) in the value of the
666
+ To create a web request session, enter a variable name, without a dollar sign, in the value of the
665
667
**SessionVariable** parameter of an `Invoke-RestMethod` command. `Invoke-RestMethod` creates the
666
668
session and saves it in the variable. In subsequent commands, use the variable as the value of the
667
669
**WebSession** parameter.
668
670
669
- You cannot use the **SessionVariable** and **WebSession** parameters in the same command.
671
+ You can't use the **SessionVariable** and **WebSession** parameters in the same command.
670
672
671
673
` ` ` yaml
672
674
Type: Microsoft.PowerShell.Commands.WebRequestSession
0 commit comments