我正致力于将列表内容类型数据中的数据导出为CSV。我能够将数据提取到CSV,但它会带来一些来自字段链接的垃圾值。
<dnn:DnnJsInclude runat="server"
PathNameAlias="SkinPath"
FilePath="js/theme.min.js"
ForceProvider="DnnFormBottomProvider"
Priority="10000" />
并且输出包含一些带有数据的错误值,我复制了两个字段值:
$url = "http://mysite/abc"
$listName = "Issues"
$web = Get-SPWeb $url
$list = $web.Lists.TryGetList($listName)
$fields = $list.ContentTypes | %{ $_.FieldLinks }
$items = @() #array to store objects representing list items
$list.Items | %{
$item = $_;
$hash = @{}; #hash table to store field name-value pairs
$fields | %{ $hash[$_.DisplayName] = $item[$_.DisplayName] };
$items += New-Object PSObject -Property $hash
}
$items | Export-Csv -Path "C:\Temp\test2.csv" -NoTypeInformation
和
<div class="ExternalClass756614A031B94F15B792C243E62683BA"><p>?Vacations rearranged to remove conflict.  No impact to project schedule</p></div>