0
因为我有工作的OAuth和可以得到的PowerShell原生谷歌CAL条目是这样的:谷歌日历插页的PowerShell
$from=$((Get-Date).adddays(-1)).ToString("yyyy-MM-ddTHH:mm:ss-ff:ff")
$to=$((Get-Date).adddays(+7)).ToString("yyyy-MM-ddTHH:mm:ss-ff:ff")
$Events = Invoke-RestMethod -Uri `
"https://www.googleapis.com/calendar/v3/calendars/$calid/events?access_token=$accesstoken&timeMin=$from&timeMax=$to"
我现在正在试图找出如何做插入和真的不知道如何告诉API我想要做的插入:
$NewEvent = @{
summary="Google I/O 2015";
location="800 Howard St., San Francisco, CA 94103";
description="A chance to hear more about Google developer products.";
start = @{
date_time ="2017-10-09T09:00:00-07:00";
time_zone =" ''America/Los_Angeles''";
}
}
$ReturnI = Invoke-RestMethod -Uri `
"https://www.googleapis.com/calendar/v3/calendars/$calid/events?access_token=$accesstoken&Method=insert" -Method Get -body $NewEvent
我的问题是因此一)有我犯了一个有效的$ NewEvent和b)我怎么做一个Invoke-RestMethod到coraspond到谷歌的API方法?
感谢
你可能不得不改变方法发布 –