
私は Server Core マシンを管理しており、PowerShell ですべてを実行しようとしていますが、これは楽しいことです。既定のドキュメントのリストが必要です。他の Web サイトから、xxx-WebConfiguration と xxx-WebConfigurationProperty の両方を使用して、それらを設定および削除する方法を見つけました。試したことは次のとおりです。
Get-WebConfigurationProperty -Filter /system.webServer/defaultDocument -PSPath "IIS:\sites\Default Web Site" -Name files
しかし、それは次のようになります:
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
それはあまり役に立ちません。
答え1
実際のドキュメント名は階層のさらに深いところにあります。デフォルトのドキュメントのリストを取得する方法は次のとおりです。
Get-WebConfigurationProperty -Filter /system.webServer/defaultDocument/files/add -PSPath "IIS:\sites\Default Web Site" -Name value | Select value