An API that connects multiple Microsoft services, enabling data access and automation across platforms
Hi @Vasil Michev ,
Its working now. Thank you for your help.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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,
An API that connects multiple Microsoft services, enabling data access and automation across platforms
Hi @Vasil Michev ,
Its working now. Thank you for your help.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted commentComments have been turned off. Learn more
The full code would be helpful, but assuming you are storing the response in $resp variable, it will be something like:
($resp.Content | ConvertFrom-Json).'@odata.count'