Powershell 和Sharepoint 通过视图将列表项导出到 csv
我正在尝试通过特定视图从共享点列表中导出项目。
我已经成功返回了项目,但现在我无法正确地将其导出到 csv 文件,
这是我迄今为止所拥有的:
$web = Get-SPWeb $url
$splist = $web.Lists[$listname]
$view = $splist.Views["Current Month"]
$items = $splist.GetItems($view)
$items | Select-Object "Check Number", "Purchaser" | Export-Csv -Path f:\test.csv
$web.Dispose()
提前谢谢您!
I am attempting to export items from a sharepoint list via a specific View.
I have the items returning successfully but now I am stuck trying to export it to a csv file correctly
here is what i have thus far:
$web = Get-SPWeb $url
$splist = $web.Lists[$listname]
$view = $splist.Views["Current Month"]
$items = $splist.GetItems($view)
$items | Select-Object "Check Number", "Purchaser" | Export-Csv -Path f:\test.csv
$web.Dispose()
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 sharepoint 2007,
您必须先从 SPListItem 属性构建选择对象,然后再将其传递到 Export-CSV
For sharepoint 2007
You have to build your select object up from the SPListItem properties before passing it to Export-CSV