小编SGa*_*att的帖子

如何使用 PowerShell 获取 IIS 中的默认文档列表?

我正在管理服务器核心机器并尝试在 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)

这并没有真正的帮助。

iis powershell windows-server-core

1
推荐指数
1
解决办法
2430
查看次数

标签 统计

iis ×1

powershell ×1

windows-server-core ×1