我需要访问@ odata.nextLink;我试着通过这样做而没有运气来调用它:
$messages2 = Invoke-RestMethod $messages.odatanextLink -Credential $cred
我也试过这个但它失败了:
$messages2 = Invoke-RestMethod $messages.@odata.nextLink -Credential $cred
之前的代码是:
$url = "https://outlook.office365.com/api/v1.0/me/messages"
$date = Get-Date -Format "yyyy-MM-dd"
$messageQuery = "" + $url + "?`$select=Id&`$filter=HasAttachments eq true and DateTimeReceived ge " + $date
$messages = Invoke-RestMethod $messageQuery -Credential $cred
foreach ($message in $messages.value)
{
答案 0 :(得分:1)
在PowerShell中,您可以使用引号安全地限定成员名称:
$messages2 = Invoke-RestMethod $messages.'@odata.nextLink' -Credential $cred