Get-Website返回当前安装的Websites及其Bindings的列表。
然而,
Get-Website | select Bindings返回以下内容:
bindings
--------
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
Microsoft.IIs.PowerShell.Framework.ConfigurationElement如何才能正确地将数据导出到CSV?
编辑:
如果我输入:
Get-Website | select -ExpandProperty bindings | select collection我很好地拿到了专栏。但是,我想再一次获得其他属性,如名称和物理路径。我该怎么做?
发布于 2015-05-03 15:27:12
这应该是对你有用的东西
Get-website | select Name,PhysicalPath, @{L="Bindings";E={$_.Bindings.Collection -join ";"}}我们使用一个计算表达式分解绑定,并使用分号对数组元素进行-join,以允许导出它。这些数据应该可以通过Export-CSV轻松地导出。
Bindings是一个对象,而不仅仅是一个字符串集合。有些方法内置了ToString()方法,可以为您解决这一问题,但似乎并不是这样的,因此我们需要手动处理。
https://stackoverflow.com/questions/30015148
复制相似问题