我正在管理服务器核心机器并尝试在 PowerShell 中完成所有操作,这很有趣。我需要一个默认文件的列表。从其他网站,我发现了如何使用 xxx-WebConfiguration 和 xxx-WebConfigurationProperty 设置和删除它们。我试过了:
Get-WebConfigurationProperty -Filter /system.webServer/defaultDocument -PSPath "IIS:\sites\Default Web Site" -Name files
Run Code Online (Sandbox Code Playgroud)
但它给出了:
Collection : {Microsoft.IIs.PowerShell.Framework.ConfigurationElement, Microsoft.IIs.PowerShell.Framework.Configuration
Element, Microsoft.IIs.PowerShell.Framework.ConfigurationElement, Microsoft.IIs.PowerShell.Framework.Confi
gurationElement...}
ItemXPath : /system.webServer/defaultDocument
Attributes : {}
ChildElements : {}
ElementTagName : files
Methods :
Schema : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema
Run Code Online (Sandbox Code Playgroud)
这并没有真正的帮助。