Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Reads Outlook calendar events and inbox, sends emails, and schedules meetings via PowerShell COM or Microsoft Graph.
Use this skill ↓60% 76%+16 ptsof test cases passed
Passed 19 of 25 test cases with the skill, and 15 of 25 without it.
If desktop Outlook COM is unavailable and I need to query the calendar via Microsoft Graph API in PowerShell using Invoke-RestMethod, which environment variable should contain the access token?
Identifies $env:GRAPH_TOKEN as the environment variable for the Graph token
3 of 3 safety checks passed
Read Outlook calendar events, check inbox, send emails, and schedule meetings using PowerShell COM automation or Microsoft Graph API — no browser required.
$outlook = New-Object -ComObject Outlook.Application
$ns = $outlook.GetNamespace("MAPI")
$cal = $ns.GetDefaultFolder(9) # 9 = olFolderCalendar
$today = [DateTime]::Today
$items = $cal.Items
$items.IncludeRecurrences = $true
$items.Sort("[Start]")
$filter = "[Start] >= '$($today.ToString('g'))' AND [Start] < '$($today.AddDays(1).ToString('g'))'"
$items.Restrict($filter) | Select-Object Subject, Start, End, Location
$outlook = New-Object -ComObject Outlook.Application
$ns = $outlook.GetNamespace("MAPI")
$inbox = $ns.GetDefaultFolder(6) # 6 = olFolderInbox
$inbox.Items | Where-Object { $_.UnRead -eq $true } |
Select-Object Subject, SenderName, ReceivedTime |
Sort-Object ReceivedTime -Descending |
Select-Object -First 10
$outlook = New-Object -ComObject Outlook.Application
Next to this one in the catalogue, plus more from the same author.