diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index a0848ecba844..73fd4ea10923 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/29/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -44,6 +44,13 @@ data. This cmdlet is introduced in Windows PowerShell 3.0. This command can be run using the `irm` alias. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Get the PowerShell RSS feed diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 822d63036638..9dba9527fcce 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/16/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -62,6 +62,12 @@ This cmdlet was introduced in Windows PowerShell 3.0. > For more information about this security update, see > [PowerShell 5.1: Preventing script execution from web content](https://support.microsoft.com/KB/5074596). +By default, the HTTP request includes default values for the following HTTP headers: + +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. This command can be run using the `iwr`, `curl`, or `wget` aliases. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index cf1b761ce9bb..627e37311945 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -116,6 +116,14 @@ variables. See the [NOTES](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Get the PowerShell RSS feed diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 8e351604b603..b6fdd1b40f32 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -105,6 +105,14 @@ variables. See the [Notes](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Send a web request diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index f20e54ab454a..7ce24d4890b4 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -116,6 +116,14 @@ variables. See the [NOTES](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Get the PowerShell RSS feed diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index efc9fa1bd07e..baf58d257113 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -105,6 +105,14 @@ variables. See the [Notes](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Send a web request diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 8164bd8c7532..33d839e824ef 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -116,6 +116,14 @@ variables. See the [NOTES](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Get the PowerShell RSS feed diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 1c64c2c7db79..a917ee5d01d0 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/10/2025 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -105,6 +105,14 @@ variables. See the [Notes](#notes) section of this article. Beginning in PowerShell 7.4, character encoding for requests defaults to UTF-8 instead of ASCII. If you need a different encoding, you must set the `charset` attribute in the `Content-Type` header. +By default, the HTTP request includes default values for the following HTTP headers: + +- `Accept-Encoding` +- `Host` +- `User-Agent` + +Use the **Headers** parameter to add other headers or override the default values. + ## EXAMPLES ### Example 1: Send a web request