Powershell & Sharepoint export list items via view to csv -


i attempting export items sharepoint list via specific view.

i have items returning stuck trying export csv file correctly

here have 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 in advance!

for sharepoint 2007

[reflection.assembly]::loadwithpartialname("microsoft.sharepoint") | out-null $site = new-object microsoft.sharepoint.spsite("http://yoursite") $web = $site.rootweb $list = $web.lists[$listname] $view = $list.views["current month"]  $items = $list.getitems($view) $items | %{ select-object -input $_ -prop @{name='title';expression={$_.title;}}, @{name='check number';expression={$_["check number"];}}; } | export-csv -path c:\test.csv 

you have build select object splistitem properties before passing export-csv


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -