Skip to content

Instantly share code, notes, and snippets.

@sebug
Created January 12, 2018 17:04
Show Gist options
  • Save sebug/994ee4033c32f4f4f1b0ac06327f7395 to your computer and use it in GitHub Desktop.
Save sebug/994ee4033c32f4f4f1b0ac06327f7395 to your computer and use it in GitHub Desktop.
Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook"
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$inbox = $namespace.GetDefaultFolder([Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderInbox)
$inbox.Items($inbox.Items.Count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment