Hi,
I am writing a powershell script to retrieve the count of unread emails of an user using Microsoft Graph API.
However its returning me a full response as below, however I only want to retrieve the value 281 of "@odata.count" field in the response and display as output of my powershell script.
Could you please help me with this query? How can I achieve this or whether this is possible and if yes, how to use this in powershell script?
Thank you.
> {
> "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('677887655689900098888')/messages",
> "@odata.count": 281,
> "value": [
> {
> "@odata.etag": "WAAAA\AACCCNNJHHHHFHHJF"",
> "id": "WAAAA\AACCCNNJHHHHFHHJWAAAA\AACCCNNJHHHHFHHJFWAAAA\AACCCNNJHHHHFHHJFWAAAA\AACCCNNJHHHHFHHJF=",
> "createdDateTime": "2021-05-03T14:19:22Z",
> "lastModifiedDateTime": "2021-05-03T14:19:24Z",
> "changeKey": "CQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAOIXIRc",
> "categories": [],
> "receivedDateTime": "2021-05-03T14:19:23Z",
> "sentDateTime": "2021-05-03T14:19:23Z",
> "hasAttachments": false,