Skip to content

Commit 494fe71

Browse files
author
Sean Wheeler
authored
restoring changes made in PR#1870 (#2089)
1 parent 4ec3c46 commit 494fe71

File tree

2 files changed

+209
-222
lines changed

2 files changed

+209
-222
lines changed

reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ms.date: 2017-06-09
2+
ms.date: 2017-11-17
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
@@ -115,12 +115,12 @@ $Body = @{
115115
earliest_time = "-2d@d"
116116
latest_time = "-1d@d"
117117
}
118-
Invoke-RestMethod -Method 'Post' -Uri $url -Credential $Cred -Body $body -SkipCertificateCheck -OutFile output.csv
118+
Invoke-RestMethod -Method 'Post' -Uri $url -Credential $Cred -Body $body -SkipCertificateCheck -OutFile output.csv
119119
```
120120

121-
In the above example, a user runs `Invoke-RestMethod` to perform a POST request on an intranet website in the user's organization.
121+
In the above example, a user runs `Invoke-RestMethod` to perform a POST request on an intranet website in the user's organization.
122122

123-
First, credentials are prompted for and then stored in `$Cred` and the URL that will be access is defined in `$Url`.
123+
First, credentials are prompted for and then stored in `$Cred` and the URL that will be access is defined in `$Url`.
124124

125125
Next, The `$Body` variable describes the search criteria, specifies CSV as the output mode, and specifies a time period for returned data that starts two days ago and ends one day ago. The body variable specifies values for parameters that apply to the particular REST API with which `Invoke-RestMethod` is communicating.
126126

@@ -165,12 +165,12 @@ Available Authentication Options:
165165
- **OAuth**: Requires **-Token**. Will send and RFC 6750 `Authorization: Bearer` header with the supplied token. This is an alias for **Bearer**
166166

167167
Supplying **-Authentication** will override any `Authorization` headers supplied to **-Headers** or included in **-WebSession**.
168-
168+
169169

170170
```yaml
171171
Type: WebAuthenticationType
172172
Parameter Sets: (All)
173-
Aliases:
173+
Aliases:
174174
Accepted values: None, Basic, Bearer, OAuth
175175
176176
Required: False
@@ -577,7 +577,7 @@ Accept wildcard characters: False
577577
```
578578

579579
### -ResponseHeadersVariable
580-
Creates a Response Headers Dictionary and saves it in the value of the specified variable. The the keys of the dictionary will contain the field names of the Response Header returned by the web server and the values will be the respective field values.
580+
Creates a Response Headers Dictionary and saves it in the value of the specified variable. The the keys of the dictionary will contain the field names of the Response Header returned by the web server and the values will be the respective field values.
581581

582582

583583
```yaml
@@ -624,7 +624,7 @@ Accept wildcard characters: False
624624
625625
```
626626
### -SkipCertificateCheck
627-
Skips certificate validation checks. This includes all validations such as expiration, revocation, trusted root authority, etc.
627+
Skips certificate validation checks. This includes all validations such as expiration, revocation, trusted root authority, etc.
628628

629629
> **Warning**: Using this parameter is not secure and is not recommended. This switch is only intended to be used against known hosts using a self-signed certificate for testing purposes. Use at your own risk.
630630

@@ -670,7 +670,7 @@ Sets the SSL/TLS protocols that are permissible for the web request. By default
670670
```yaml
671671
Type: WebSslProtocol
672672
Parameter Sets: (All)
673-
Aliases:
673+
Aliases:
674674
Accepted values: Default, Tls, Tls11, Tls12
675675
676676
Required: False
@@ -701,7 +701,7 @@ Accept wildcard characters: False
701701
```
702702

703703
### -Token
704-
The OAuth or Bearer token to include in the request. **-Token** is required by certain **-Authentication** options. It cannot be used independently.
704+
The OAuth or Bearer token to include in the request. **-Token** is required by certain **-Authentication** options. It cannot be used independently.
705705

706706
**-Token** takes a `SecureString` containing the token. To supply the token manually use the following:
707707

@@ -712,7 +712,7 @@ Invoke-RestMethod -Uri $uri -Authentication OAuth -Token (Read-Host -AsSecureStr
712712
```yaml
713713
Type: SecureString
714714
Parameter Sets: (All)
715-
Aliases:
715+
Aliases:
716716
717717
Required: False
718718
Position: Named
@@ -874,5 +874,4 @@ Some features may not be available on all platforms.
874874

875875
[ConvertFrom-Json](ConvertFrom-Json.md)
876876

877-
[Invoke-WebRequest](Invoke-WebRequest.md)
878-
877+
[Invoke-WebRequest](Invoke-WebRequest.md)

0 commit comments

Comments
 (0)