【发布时间】:2016-06-27 20:58:09
【问题描述】:
我想尝试遍历应用程序在 IIS 中的所有可用配置选项,以便我可以通过 PowerShell 设置它们。我对 IIS 或 PowerShell 并不十分熟悉,所以我正在尽力而为。以下输出是我尝试遍历应用程序的所有配置时得到的结果。
PS C:\Users\User01> $siteName = "CustomApp"
PS C:\Users\User01> $authentications = Get-WebConfiguration -filter "system.webServer/*" -PSPath "IIS:\Sites\Default Web Site\$siteName"
PS C:\Users\User01> foreach ($auth in $authentications) { Write-Host $auth }
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
PS C:\Users\User01> $authentications = Get-WebConfiguration -filter "system.webServer/*" -PSPath "IIS:\Sites\Default Web Site\$siteName" -Recurse
PS C:\Users\User01> foreach ($auth in $authentications) { Write-Host $auth }
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
Microsoft.IIs.PowerShell.Framework.ConfigurationSection
我应该怎么做才能获得实际的项目名称而不是显示的名称?
【问题讨论】:
标签: asp.net windows powershell iis