Updates from: 03/01/2022 02:18:32
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Utility Invoke Restmethod (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/27/2021 Last updated : 02/28/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Invoke-RestMethod
Accept wildcard characters: False
### -SessionVariable
-Creates a web request session and saves it in the value of the specified variable. Enter a variable
-name without the dollar sign (`$`) symbol.
+Creates a variable containing the web request session. Enter a variable name without the dollar sign
+(`$`) symbol.
When you specify a session variable, `Invoke-RestMethod` creates a web request session object and assigns it to a variable with the specified name in your PowerShell session. You can use the variable in your session as soon as the command completes.
-Unlike a remote session, the web request session is not a persistent connection. It is an object
-that contains information about the connection and the request, including cookies, credentials, the
+Unlike a remote session, the web request session isn't a persistent connection. It's an object that
+contains information about the connection and the request, including cookies, credentials, the
maximum redirection value, and the user agent string. You can use it to share state and data among web requests. To use the web request session in subsequent web requests, specify the session variable in the value
-of the **WebSession** parameter. Windows PowerShell uses the data in the web request session object
-when establishing the new connection. To override a value in the web request session, use a cmdlet
+of the **WebSession** parameter. PowerShell uses the data in the web request session object when
+establishing the new connection. To override a value in the web request session, use a cmdlet
parameter, such as **UserAgent** or **Credential**. Parameter values take precedence over values in the web request session.
-You cannot use the **SessionVariable** and **WebSession** parameters in the same command.
+You can't use the **SessionVariable** and **WebSession** parameters in the same command.
```yaml Type: System.String
Microsoft.PowerShell.Utility Invoke Restmethod (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/27/2021 Last updated : 02/28/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Invoke-RestMethod
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases: FL
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: True Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ``` ### -ResponseHeadersVariable
-Creates a Response Headers Dictionary and saves it in the value of the specified variable. 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.
+Creates a variable containing a Response Headers Dictionary. Enter a variable name without the
+dollar sign (`$`) symbol. The keys of the dictionary contain the field names and values of the
+Response Header returned by the web server.
This feature was added in PowerShell 6.0.0.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -SessionVariable
-Specifies a variable for which this cmdlet creates a web request session and saves it in the value.
-Enter a variable name without the dollar sign (`$`) symbol.
+Creates a variable containing the web request session. Enter a variable name without the dollar sign
+(`$`) symbol.
When you specify a session variable, `Invoke-RestMethod` creates a web request session object and assigns it to a variable with the specified name in your PowerShell session. You can use the
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -StatusCodeVariable
-This parameter specifies a variable that's assigned a status code's integer value. The parameter can
-identify success messages or failure messages when used with the **SkipHttpErrorCheck** parameter.
+Creates a variable containing a HTTP status code result of the request. Enter a variable name
+without the dollar sign (`$`) symbol.
-Input the parameter's variable name as a string such as `-StatusCodeVariable "scv"`.
+The parameter can identify success messages or failure messages when used with the
+**SkipHttpErrorCheck** parameter.
This parameter was introduced in PowerShell 7.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Because of changes in .NET Core 3.1, PowerShell 7.0 and higher use the
[HttpClient.DefaultProxy](/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1) property to determine the proxy configuration.
-The value of this property is determined by your platform:
+The value of this property is different rules depending on your platform:
-- **For Windows**: Reads proxy configuration from environment variables. If those variables are not
- defined the property is derived from the user's proxy settings.
-- **For macOS**: Reads proxy configuration from environment variables. If those variables are not
- defined the property is derived from the system's proxy settings.
-- **For Linux**: Reads proxy configuration from environment variables. If those variables are not
- defined the property initializes a non-configured instance that bypasses all addresses.
+- **For Windows**: Reads proxy configuration from environment variables or, if those are not
+ defined, from the user's proxy settings.
+- **For macOS**: Reads proxy configuration from environment variables or, if those are not defined,
+ from the system's proxy settings.
+- **For Linux**: Reads proxy configuration from environment variables or, in case those are not
+ defined, this property initializes a non-configured instance that bypasses all addresses.
The environment variables used for `DefaultProxy` initialization on Windows and Unix-based platforms are:
Microsoft.PowerShell.Utility Invoke Restmethod (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/27/2021 Last updated : 02/28/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Invoke-RestMethod
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases: FL
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: True Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ``` ### -ResponseHeadersVariable
-Creates a Response Headers Dictionary and saves it in the value of the specified variable. 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.
+Creates a variable containing a Response Headers Dictionary. Enter a variable name without the
+dollar sign (`$`) symbol. The keys of the dictionary contain the field names and values of the
+Response Header returned by the web server.
This feature was added in PowerShell 6.0.0.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -SessionVariable
-Specifies a variable for which this cmdlet creates a web request session and saves it in the value.
-Enter a variable name without the dollar sign (`$`) symbol.
+Creates a variable containing the web request session. Enter a variable name without the dollar sign
+(`$`) symbol.
When you specify a session variable, `Invoke-RestMethod` creates a web request session object and assigns it to a variable with the specified name in your PowerShell session. You can use the
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -StatusCodeVariable
-This parameter specifies a variable that's assigned a status code's integer value. The parameter can
-identify success messages or failure messages when used with the **SkipHttpErrorCheck** parameter.
+Creates a variable containing a HTTP status code result of the request. Enter a variable name
+without the dollar sign (`$`) symbol.
+
+The parameter can identify success messages or failure messages when used with the
+**SkipHttpErrorCheck** parameter.
Input the parameter's variable name as a string such as `-StatusCodeVariable "scv"`.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Some features may not be available on all platforms.
Because of changes in .NET Core 3.1, PowerShell 7.0 and higher use the [HttpClient.DefaultProxy](/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1)
-Property to determine the proxy configuration.
+property to determine the proxy configuration.
The value of this property is different rules depending on your platform:
Microsoft.PowerShell.Utility Invoke Restmethod (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/27/2021 Last updated : 02/28/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Invoke-RestMethod
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases: FL
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: True Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ``` ### -ResponseHeadersVariable
-Creates a Response Headers Dictionary and saves it in the value of the specified variable. 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.
+Creates a variable containing a Response Headers Dictionary. Enter a variable name without the
+dollar sign (`$`) symbol. The keys of the dictionary contain the field names and values of the
+Response Header returned by the web server.
This feature was added in PowerShell 6.0.0.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -SessionVariable
-Specifies a variable for which this cmdlet creates a web request session and saves it in the value.
-Enter a variable name without the dollar sign (`$`) symbol.
+Creates a variable containing the web request session. Enter a variable name without the dollar sign
+(`$`) symbol.
When you specify a session variable, `Invoke-RestMethod` creates a web request session object and assigns it to a variable with the specified name in your PowerShell session. You can use the
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Accept wildcard characters: False
### -StatusCodeVariable
-This parameter specifies a variable that's assigned a status code's integer value. The parameter can
-identify success messages or failure messages when used with the **SkipHttpErrorCheck** parameter.
+Creates a variable containing a HTTP status code result of the request. Enter a variable name
+without the dollar sign (`$`) symbol.
+
+The parameter can identify success messages or failure messages when used with the
+**SkipHttpErrorCheck** parameter.
Input the parameter's variable name as a string such as `-StatusCodeVariable "scv"`.
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Aliases:
Required: False Position: Named
-Default value: None
+Default value: False
Accept pipeline input: False Accept wildcard characters: False ```
Microsoft.PowerShell.Utility Invoke Restmethod (7.3) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.3/Microsoft.PowerShell.Utility/Invoke-RestMethod.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 01/24/2022 Last updated : 02/28/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Invoke-RestMethod
Invoke-RestMethod -CustomMethod <String> [-FollowRelLink] [-MaximumFollowRelLink
[-SkipHeaderValidation] [<CommonParameters>] ``` - ## Description The `Invoke-RestMethod` cmdlet sends HTTP and HTTPS requests to Representational State Transfer
Accept wildcard characters: False
### -ResponseHeadersVariable
-Creates a Response Headers Dictionary and saves it in the value of the specified variable. 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.
+Creates a variable containing a Response Headers Dictionary. Enter a variable name without the
+dollar sign (`$`) symbol. The keys of the dictionary contain the field names and values of the
+Response Header returned by the web server.
This feature was added in PowerShell 6.0.0.
Accept wildcard characters: False
### -SessionVariable
-Specifies a variable for which this cmdlet creates a web request session and saves it in the value.
-Enter a variable name without the dollar sign (`$`) symbol.
+Creates a variable containing the web request session. Enter a variable name without the dollar sign
+(`$`) symbol.
When you specify a session variable, `Invoke-RestMethod` creates a web request session object and assigns it to a variable with the specified name in your PowerShell session. You can use the
Accept wildcard characters: False
### -StatusCodeVariable
-This parameter specifies a variable that's assigned a status code's integer value. The parameter can
-identify success messages or failure messages when used with the **SkipHttpErrorCheck** parameter.
+Creates a variable containing a HTTP status code result of the request. Enter a variable name
+without the dollar sign (`$`) symbol.
+
+The parameter can identify success messages or failure messages when used with the
+**SkipHttpErrorCheck** parameter.
Input the parameter's variable name as a string such as `-StatusCodeVariable "scv"`.