Como posso obter uma lista de documentos padrão no IIS usando o PowerShell?

Como posso obter uma lista de documentos padrão no IIS usando o PowerShell?

Estou gerenciando uma máquina Server Core e tentando fazer tudo no PowerShell, o que é divertido. Preciso de uma lista dos documentos padrão. Em outros sites, descobri como defini-los e removê-los, usando xxx-WebConfiguration e xxx-WebConfigurationProperty. Eu tentei:

Get-WebConfigurationProperty -Filter /system.webServer/defaultDocument -PSPath "IIS:\sites\Default Web Site" -Name files

mas dá:

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

o que realmente não ajuda.

Responder1

Os nomes reais dos documentos estão mais profundos na hierarquia. Veja como você pode obter uma lista de documentos padrão:

Get-WebConfigurationProperty -Filter /system.webServer/defaultDocument/files/add -PSPath "IIS:\sites\Default Web Site" -Name value | Select value

informação relacionada