Skip to content

Commit acc5ec8

Browse files
markekrausSean Wheeler
authored andcommitted
Web Cmdlets .NET Core 2.1 and PowerShell 6.1.0 Refresh (#2411)
1 parent 67691c3 commit acc5ec8

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Allows sending of credentials and secrets over unencrypted connections. By defau
177177

178178
> **Warning**: Using this parameter is not secure and is not recommended. It is provided only for compatibility with legacy systems that cannot provide encrypted connections. Use at your own risk.
179179
180+
This feature was added in PowerShell 6.0.0.
180181

181182
```yaml
182183
Type: SwitchParameter
@@ -202,6 +203,7 @@ Available Authentication Options:
202203

203204
Supplying **-Authentication** will override any `Authorization` headers supplied to **-Headers** or included in **-WebSession**.
204205

206+
This feature was added in PowerShell 6.0.0.
205207

206208
```yaml
207209
Type: WebAuthenticationType
@@ -228,7 +230,7 @@ For other request types (such as POST), the body is set as the value of the requ
228230

229231
When the body is a form, or it is the output of another `Invoke-WebRequest` call, PowerShell sets the request content to the form fields.
230232

231-
The **-Body** parameter may also accept a `System.Net.Http.MultipartFormDataContent` object. This will facilitate `multipart/form-data` requests. When a `MultipartFormDataContent` object is supplied for **-Body**, any Content related headers supplied to the **-ContentType**, **-Headers**, or **-WebSession** parameters will be overridden by the Content headers of the `MultipartFormDataContent` object.
233+
The **-Body** parameter may also accept a `System.Net.Http.MultipartFormDataContent` object. This will facilitate `multipart/form-data` requests. When a `MultipartFormDataContent` object is supplied for **-Body**, any Content related headers supplied to the **-ContentType**, **-Headers**, or **-WebSession** parameters will be overridden by the Content headers of the `MultipartFormDataContent` object. This feature was added in PowerShell 6.0.0.
232234

233235
```yaml
234236
Type: Object
@@ -249,8 +251,6 @@ Enter a variable that contains a certificate or a command or expression that get
249251
To find a certificate, use `Get-PfxCertificate` or use the `Get-ChildItem` cmdlet in the Certificate (`Cert:`) drive.
250252
If the certificate is not valid or does not have sufficient authority, the command fails.
251253

252-
> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
253-
254254
```yaml
255255
Type: X509Certificate
256256
Parameter Sets: (All)
@@ -338,6 +338,8 @@ Invoke-WebRequest -uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'
338338

339339
This makes a `TEST` HTTP request to the API.
340340

341+
This feature was added in PowerShell 6.0.0.
342+
341343
```yaml
342344
Type: String
343345
Parameter Sets: StandardMethod, CustomMethod
@@ -372,6 +374,8 @@ Indicates the cmdlet should follow relation links.
372374

373375
To set how many times to follow relation links, use the **-MaximumFollowRelLink** parameter.
374376

377+
This feature was added in PowerShell 6.0.0.
378+
375379
```yaml
376380
Type: SwitchParameter
377381
Parameter Sets: (All)
@@ -599,6 +603,8 @@ Indicates the cmdlet should preserve the `Authorization` header, when present, a
599603

600604
By default, the cmdlet strips the `Authorization` header before redirecting. Specifying this parameter disables this logic for cases where the header needs to be sent to the redirection location.
601605

606+
This feature was added in PowerShell 6.0.0.
607+
602608
```yaml
603609
Type: SwitchParameter
604610
Parameter Sets: (All)
@@ -615,6 +621,8 @@ Accept wildcard characters: False
615621
Uses a proxy server for the request, rather than connecting directly to the Internet resource.
616622
Enter the URI of a network proxy server.
617623

624+
This feature was added in PowerShell 6.0.0.
625+
618626
```yaml
619627
Type: Uri
620628
Parameter Sets: (All)
@@ -669,6 +677,7 @@ Accept wildcard characters: False
669677
### -ResponseHeadersVariable
670678
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.
671679

680+
This feature was added in PowerShell 6.0.0.
672681

673682
```yaml
674683
Type: String
@@ -758,6 +767,7 @@ Skips certificate validation checks. This includes all validations such as expir
758767

759768
> **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.
760769

770+
This feature was added in PowerShell 6.0.0.
761771

762772
```yaml
763773
Type: SwitchParameter
@@ -778,6 +788,8 @@ This switch should be used for sites that require header values that do not conf
778788

779789
This will disable validation for values passed to the **-ContentType**, **-Headers** and **-UserAgent** parameters.
780790

791+
This feature was added in PowerShell 6.0.0.
792+
781793
```yaml
782794
Type: SwitchParameter
783795
Parameter Sets: (All)
@@ -795,7 +807,9 @@ Sets the SSL/TLS protocols that are permissible for the web request. By default
795807

796808
**-SslProtocol** uses the `WebSslProtocol` Flag Enum. It is possible to supply more than one protocol using flag notation or combining multiple `WebSslProtocol` options with `-bor`, however supplying multiple protocols is not supported on all platforms.
797809

798-
> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
810+
> **Note**: On non-Windows platforms it may not be possible to supply `'Tls, Tls12'` as an option.
811+
812+
This feature was added in PowerShell 6.0.0.
799813

800814
```yaml
801815
Type: WebSslProtocol
@@ -839,6 +853,8 @@ The OAuth or Bearer token to include in the request. **-Token** is required by c
839853
Invoke-RestMethod -Uri $uri -Authentication OAuth -Token (Read-Host -AsSecureString)
840854
```
841855

856+
This feature was added in PowerShell 6.0.0.
857+
842858
```yaml
843859
Type: SecureString
844860
Parameter Sets: (All)
@@ -996,8 +1012,6 @@ If the request returns JSON strings, `Invoke-RestMethod` returns a PSObject that
9961012

9971013
## Notes
9981014

999-
Some features may not be available on all platforms.
1000-
10011015
## Related Links
10021016

10031017
[ConvertTo-Json](ConvertTo-Json.md)

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Allows sending of credentials and secrets over unencrypted connections. By defau
192192

193193
> **Warning**: Using this parameter is not secure and is not recommended. It is provided only for compatibility with legacy systems that cannot provide encrypted connections. Use at your own risk.
194194
195+
This feature was added in PowerShell 6.0.0.
195196

196197
```yaml
197198
Type: SwitchParameter
@@ -217,6 +218,7 @@ Available Authentication Options:
217218

218219
Supplying **-Authentication** will override any `Authorization` headers supplied to **-Headers** or included in **-WebSession**.
219220

221+
This feature was added in PowerShell 6.0.0.
220222

221223
```yaml
222224
Type: WebAuthenticationType
@@ -241,7 +243,7 @@ The **-Body** parameter can be used to specify a list of query parameters or spe
241243
When the input is a GET request and the body is an `IDictionary` (typically, a hash table), the body is added to the URI as query parameters.
242244
For other request types (such as POST), the body is set as the value of the request body in the standard name=value format.
243245

244-
The **-Body** parameter may also accept a `System.Net.Http.MultipartFormDataContent` object. This will facilitate `multipart/form-data` requests. When a `MultipartFormDataContent` object is supplied for **-Body**, any Content related headers supplied to the **-ContentType**, **-Headers**, or **-WebSession** parameters will be overridden by the Content headers of the `MultipartFormDataContent` object.
246+
The **-Body** parameter may also accept a `System.Net.Http.MultipartFormDataContent` object. This will facilitate `multipart/form-data` requests. When a `MultipartFormDataContent` object is supplied for **-Body**, any Content related headers supplied to the **-ContentType**, **-Headers**, or **-WebSession** parameters will be overridden by the Content headers of the `MultipartFormDataContent` object. This feature was added in PowerShell 6.0.0.
245247

246248
```yaml
247249
Type: Object
@@ -262,8 +264,6 @@ Enter a variable that contains a certificate or a command or expression that get
262264
To find a certificate, use `Get-PfxCertificate` or use the `Get-ChildItem` cmdlet in the Certificate (`Cert:`) drive.
263265
If the certificate is not valid or does not have sufficient authority, the command fails.
264266

265-
> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
266-
267267
```yaml
268268
Type: X509Certificate
269269
Parameter Sets: (All)
@@ -351,6 +351,8 @@ Invoke-WebRequest -uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'
351351

352352
This makes a `TEST` HTTP request to the API.
353353

354+
This feature was added in PowerShell 6.0.0.
355+
354356
```yaml
355357
Type: String
356358
Parameter Sets: CustomMethod, CustomMethodNoProxy
@@ -526,6 +528,8 @@ Indicates that the cmdlet will not use a proxy to reach the destination.
526528

527529
When you need to bypass the proxy configured in the environment, use this switch.
528530

531+
This feature was added in PowerShell 6.0.0.
532+
529533
```yaml
530534
Type: SwitchParameter
531535
Parameter Sets: StandardMethodNoProxy, CustomMethodNoProxy
@@ -579,6 +583,8 @@ Indicates the cmdlet should preserve the `Authorization` header, when present, a
579583

580584
By default, the cmdlet strips the `Authorization` header before redirecting. Specifying this parameter disables this logic for cases where the header needs to be sent to the redirection location.
581585

586+
This feature was added in PowerShell 6.0.0.
587+
582588
```yaml
583589
Type: SwitchParameter
584590
Parameter Sets: (All)
@@ -721,6 +727,8 @@ Skips certificate validation checks. This includes all validations such as expir
721727

722728
> **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.
723729

730+
This feature was added in PowerShell 6.0.0.
731+
724732
```yaml
725733
Type: SwitchParameter
726734
Parameter Sets: (All)
@@ -740,6 +748,8 @@ This switch should be used for sites that require header values that do not conf
740748

741749
This will disable validation for values passed to the **-ContentType**, **-Headers** and **-UserAgent** parameters.
742750

751+
This feature was added in PowerShell 6.0.0.
752+
743753
```yaml
744754
Type: SwitchParameter
745755
Parameter Sets: (All)
@@ -757,7 +767,9 @@ Sets the SSL/TLS protocols that are permissible for the web request. By default
757767

758768
**-SslProtocol** uses the `WebSslProtocol` Flag Enum. It is possible to supply more than one protocol using flag notation or combining multiple `WebSslProtocol` options with `-bor`, however supplying multiple protocols is not supported on all platforms.
759769

760-
> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
770+
> **Note**: On non-Windows platforms it may not be possible to supply `'Tls, Tls12'` as an option.
771+
772+
This feature was added in PowerShell 6.0.0.
761773

762774
```yaml
763775
Type: WebSslProtocol
@@ -801,6 +813,8 @@ The OAuth or Bearer token to include in the request. **-Token** is required by c
801813
Invoke-WebRequest -Uri $uri -Authentication OAuth -Token (Read-Host -AsSecureString)
802814
```
803815

816+
This feature was added in PowerShell 6.0.0.
817+
804818
```yaml
805819
Type: SecureString
806820
Parameter Sets: (All)
@@ -955,8 +969,6 @@ You can pipe the body of a web request to `Invoke-WebRequest`.
955969

956970
## NOTES
957971

958-
Some features may not be available on all platforms.
959-
960972
Beginning with PowerShell 6.0.0 `Invoke-WebRequest` supports basic parsing only.
961973

962974
## RELATED LINKS

0 commit comments

Comments
 (0)