Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Get the Target List
- $list = $web.Lists["Stand-By rooster AM Ambot"]
- #Get the View
- $view = $list.Views["Uitprinten"]
- #Get All items from the view
- $items = $list.GetItems($view)
- #Array to Hold Result - PSObjects
- $ListItemCollection = @()
- #Get All List items where Status is "In Progress"
- $items | foreach {
- $ExportItem = New-Object PSObject
- $ExportItem | Add-Member -MemberType NoteProperty -name "Datum" -value $_["Datum"].ToLocalTime().ToString("dd.MM.yyyy");
- $ExportItem | Add-Member -MemberType NoteProperty -Name "00:00 - 07:59" -value $_["00:00 - 07:59"]
- $ExportItem | Add-Member -MemberType NoteProperty -name "08:00 - 16:59" -value $_["08:00 - 16:59"]
- $ExportItem | Add-Member -MemberType NoteProperty -name "17:00 - 23:59" -value $_["17:00 - 23:59"]
- $ExportItem | Add-Member -MemberType NoteProperty -name "Opmerkingen" -value $_["Opmerkingen"]
- #Add the object with property to an Array
- $ListItemCollection += $ExportItem
- }
- #Export the result Array to CSV file
- $ListItemCollection | epcsv "c:tempStand-By rooster AM Ambot.csv" -NoT
- #Dispose the web Object
- $web.Dispose()
Add Comment
Please, Sign In to add comment