Created
January 8, 2017 22:04
-
-
Save mattmcnabb/7328efdb65f49bab925aac0d45af0427 to your computer and use it in GitHub Desktop.
Testing Async calls to Office 365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PowerShell = [powershell]::Create() | |
$null = $PowerShell.AddScript({ | |
param($Credential) | |
$ExchParams = @{ | |
ConfigurationName = 'microsoft.exchange' | |
ConnectionUri = "https://outlook.office365.com/powershell-liveid/" | |
Credential = $Credential | |
Authentication = 'Basic' | |
AllowRedirection = $true | |
} | |
$ExchSession = New-PSSession @ExchParams | |
Import-PSSession -Session $ExchSession | |
Get-Mailbox Matt | |
}).AddArgument($Cred) | |
$Handle = $PowerShell.BeginInvoke() | |
$PowerShell.EndInvoke($Handle) | |
$PowerShell.Dispose() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment