在IIS上,按照以下步骤允许禁用/启用父路径选项:
Log into the IIS Administration Console.
Open the Directory Browsing section.
Select On or Off to enable or disable the Parent Paths option.
Click Set Parent Paths to save your setting.我正在尝试获取此设置的状态,以查看是否通过cmd/PowerShell启用或禁用该设置,然而,在此在线上似乎没有多少信息,这可能通过命令行吗?
发布于 2022-04-21 03:35:41
可以使用此powershell命令启用或禁用父路径。只需将值更改为true或false即可。
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "system.webServer/asp" -name "enableParentPaths" -value "False"是。如果您想获得它的配置值,可以使用这个值。
Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "system.webServer/asp" -name "enableParentPaths" | select value

https://stackoverflow.com/questions/71942696
复制相似问题