【发布时间】:2021-02-25 12:13:20
【问题描述】:
我想查找特定网站的自定义标题。
我可以使用以下命令查看原始属性。我认为这是所有网站的全球价值。我为一些网站创建了一些标题。但我无法查看它。是否有查看特定站点的命令。
>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
更新
我可以使用以下命令找到。
> Get-IISConfigSection -SectionPath system.webServer/httpProtocol -CommitPath "testsite" | Get-IISConfigCollection -CollectionName "customHeaders"
但我无法提取名称和值。
我使用了select-object rawattribute,但它给出了空{}
【问题讨论】:
标签: windows powershell iis http-headers