Skip to content

Web Cmdlets .NET Core 2.1 and PowerShell 6.1.0 Refresh #2411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
Original file line number Diff line number Diff line change
@@ -177,6 +177,7 @@ Allows sending of credentials and secrets over unencrypted connections. By defau

> **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.
This feature was added in PowerShell 6.0.0.

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

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

This feature was added in PowerShell 6.0.0.

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

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.

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.
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.

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

> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.

```yaml
Type: X509Certificate
Parameter Sets: (All)
@@ -338,6 +338,8 @@ Invoke-WebRequest -uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: String
Parameter Sets: StandardMethod, CustomMethod
@@ -372,6 +374,8 @@ Indicates the cmdlet should follow relation links.

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -599,6 +603,8 @@ Indicates the cmdlet should preserve the `Authorization` header, when present, a

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.

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -615,6 +621,8 @@ Accept wildcard characters: False
Uses a proxy server for the request, rather than connecting directly to the Internet resource.
Enter the URI of a network proxy server.

This feature was added in PowerShell 6.0.0.

```yaml
Type: Uri
Parameter Sets: (All)
@@ -669,6 +677,7 @@ Accept wildcard characters: False
### -ResponseHeadersVariable
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.

This feature was added in PowerShell 6.0.0.

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

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

This feature was added in PowerShell 6.0.0.

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

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -795,7 +807,9 @@ Sets the SSL/TLS protocols that are permissible for the web request. By default

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

> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
> **Note**: On non-Windows platforms it may not be possible to supply `'Tls, Tls12'` as an option.

This feature was added in PowerShell 6.0.0.

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SecureString
Parameter Sets: (All)
@@ -996,8 +1012,6 @@ If the request returns JSON strings, `Invoke-RestMethod` returns a PSObject that

## Notes

Some features may not be available on all platforms.

## Related Links

[ConvertTo-Json](ConvertTo-Json.md)
24 changes: 18 additions & 6 deletions reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md
Original file line number Diff line number Diff line change
@@ -192,6 +192,7 @@ Allows sending of credentials and secrets over unencrypted connections. By defau

> **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.
This feature was added in PowerShell 6.0.0.

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

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: WebAuthenticationType
@@ -241,7 +243,7 @@ The **-Body** parameter can be used to specify a list of query parameters or spe
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.
For other request types (such as POST), the body is set as the value of the request body in the standard name=value format.

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.
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.

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

> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.

```yaml
Type: X509Certificate
Parameter Sets: (All)
@@ -351,6 +351,8 @@ Invoke-WebRequest -uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: String
Parameter Sets: CustomMethod, CustomMethodNoProxy
@@ -526,6 +528,8 @@ Indicates that the cmdlet will not use a proxy to reach the destination.

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: StandardMethodNoProxy, CustomMethodNoProxy
@@ -579,6 +583,8 @@ Indicates the cmdlet should preserve the `Authorization` header, when present, a

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.

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -721,6 +727,8 @@ Skips certificate validation checks. This includes all validations such as expir

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -740,6 +748,8 @@ This switch should be used for sites that require header values that do not conf

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
@@ -757,7 +767,9 @@ Sets the SSL/TLS protocols that are permissible for the web request. By default

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

> **Note**: This feature may not work on OS platforms where `libcurl` is configured with a TLS provider other than OpenSSL.
> **Note**: On non-Windows platforms it may not be possible to supply `'Tls, Tls12'` as an option.

This feature was added in PowerShell 6.0.0.

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

This feature was added in PowerShell 6.0.0.

```yaml
Type: SecureString
Parameter Sets: (All)
@@ -955,8 +969,6 @@ You can pipe the body of a web request to `Invoke-WebRequest`.

## NOTES

Some features may not be available on all platforms.

Beginning with PowerShell 6.0.0 `Invoke-WebRequest` supports basic parsing only.

## RELATED LINKS