Hi @sco gordo
You could try the code as following:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Web
$web = Get-SPWeb -Identity "url"
#Get the Target List
$list = $web.Lists["listname"]
#Array to Hold Result - PSObjects
$ListItemCollection = @()
#Today's date
$To = Get-date
#Date+30
$Date = (Get-date).AddDays(30)
$list.Items | Where-Object { $_["EventDate"] -le $Date -and $_["EventDate"] -ge $To}| foreach {
$ExportItem = New-Object PSObject
$ExportItem | Add-Member -MemberType NoteProperty -name "Title" -value $_["Title"]
$ExportItem | Add-Member -MemberType NoteProperty -Name "EventDate" -value $_["EventDate"]
#Add the object with property to an Array
$ListItemCollection += $ExportItem
}
#Export the result Array to CSV file
$ListItemCollection | Export-CSV "c:\Listluyi.csv" -NoTypeInformation
#Dispose the web Object
$web.Dispose()
Please change the paremeter as your need.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.