Date-issue with calendar output

Hello,

I hope someone can help med with this.

I am having an issue when trying to retrieve calendar entries for at user.
I have been building a script with a datepicker, where I can choose startdate, enddate and username and all that seems to work.
When I run the datepicker only I get the results I want.

The problem is the output.
I am using the Get-CalendarDiagnosticObjects to get data out of a calendar lige this:
Get-CalendarDiagnosticObjects -Identity $tBoxInitialer.Text -startdate ($startDatePicker.Value.Date) | Select-object NormalizedSubject, Location, starttime, endtime, CreationTime, ParentDisplayName | Where-object ParentDisplayName -EQ Kalender | Export-csv -path $path -Encoding unicode

Explanation:
$tBoxInitialer.Text: is from the datepicker, where I also enter the username.
-Startdate ($startDatePicker.Value.Date): Startdate from the date picker
Where-object ParentDisplayName -EQ Kalender: Filter out alle other unnecessary
Export-csv -path $path -Encoding unicode: And in the end Exporting the results to a CSV file.

When using my own username I get nothing on the 30th of January even though I know there is an entry in my calendar for that date.
The weird thing is, that if I run the same command for the 28th of January I get the entry for the 30th of January even though I addede the entry today (the 29th of january)

Also I have to filter out the ParentDisplayName with a where-object or else I am getting a lot of unnecessary data (including the calendar of my colleague)

My question is:
What can be causing the wrong outputs? Am I using the wrong cmdlet (get-calendardiagnosticobjects)?
Can it be different dateformats causing trouble?
Why am I also getting the calendar entries of my Collegue?

I have been spending a lot of time with this date-issue and I have to admint, that it’s a bit frustrating :slight_smile:

Best regards,
Henrik