Sets an HTTP header for a website or a directory under a website.
Set-IisHttpHeader [-SiteName] <String> [[-VirtualPath] <String>] [-Name] <String> [-Value] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
If the HTTP header doesn't exist, it is created. If a header exists, its value is replaced.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SiteName | String | The name of the website where the HTTP header should be set/created. | true | false | |
VirtualPath | String | The optional path under SiteName where the HTTP header should be set/created. |
false | false | |
Name | String | The name of the HTTP header. | true | false | |
Value | String | The value of the HTTP header. | true | false | |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Set-IisHttpHeader -SiteName 'SopwithCamel' -Name 'X-Flown-By' -Value 'Snoopy'
Sets or creates the SopwithCamel
website's X-Flown-By
HTTP header to the value Snoopy
.
Set-IisHttpHeader -SiteName 'SopwithCamel' -VirtualPath 'Engine' -Name 'X-Powered-By' -Value 'Root Beer'
Sets or creates the SopwithCamel
website's Engine
sub-directory's X-Powered-By
HTTP header to the value Root Beer
.