我在下面的PowerShell中工作得很好,直到去年11月份的第一次。powershell https://outlook.office365.com/api/v1.0/me/messages
$url = "https://outlook.office365.com/api/v1.0/me/messages"
$date = Get-Date -Format "yyyy-MM-d"
## Get all messages that have attachments where received date is greater than $date
$messageQuery = "" + $url + "?`$select=Id&`$filter=HasAttachments eq true and DateTimeReceived ge " + $date
$messages = Invoke-RestMethod $messageQuery -Credential $cred
我得到下面的错误: 调用-RestMethod:远程服务器返回错误:(400)错误的请求。 在G:\ Powell \ AutoetForO.ps1:23 char:13 + $ messages = Invoke-RestMethod $ messageQuery -Credential $ cred + ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~类别信息: ,WebException + FullyQualifiedErrorId:WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
根据我的调查;我知道它不是凭证问题;我认为他们改变了他们的API。
我在那里看不到问题。 –
问题是:“我怎样才能使它工作?”。它一直工作到11月1日。这个错误根本没有帮助;我知道它不是凭据相关的。 – Chicago1988