I want to find the custom headers for a particular site.
I am able to view the raw attributes using the below command. I think this is global value for all sites. I have created some headers for some sites. But I am not able to view it. Is there a command to view for a particular site.
>Get-IISConfigSection -SectionPath system.webServer/httpProtocol | Get-IISConfigCollection -CollectionName "customHeaders"
Attributes : {name, value}
ChildElements : {}
ElementTagName : add
IsLocallyStored : True
Methods :
RawAttributes : {[name, X-Powered-By], [value, ASP.NET]}
Schema : Microsoft.Web.Administration.ConfigurationElementSchema
UPDATE
I was able to find using the below command.
> Get-IISConfigSection -SectionPath system.webServer/httpProtocol -CommitPath "testsite" | Get-IISConfigCollection -CollectionName "customHeaders"
But I am not able to extract the name and value.
I used select-object rawattribute, but it gives empty {}