I'm trying to retrieve Google Calendar events and bulk-copy them into a SQL Server table.
$requestUri = "https://www.googleapis.com/calendar/v3/calendars/.../events"
$calEvents = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken"} -Uri $requestUri -Method Get -Body $Parameters -ContentType "application/json; charset=utf-8"
$dt = $calEvents.items | Select-Object id, ????????? | Out-DataTable
...
$bulkCopy.WriteToServer($dt)
So my question is what to put into ????? so I would be able to save for organizer-email, creator-email, start-date, end-date into the table.
$calEvents.items looks like this:
created : 2017-08-28T07:18:19.000Z
updated : 2017-08-29T16:41:00.441Z
summary : Vacation
creator : @{[email protected]; displayName=XXX}
organizer : @{[email protected]}
start : @{date=2018-03-26}
end : @{date=2018-03-31}
...
So I want to retrieve only email and date elements from @{} multivalues.
Any idea how?
(I know I can expand only one property).