msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Support Keystoke (ctrl-c) cancellation for Connect-MgGraph
When using connect-mggraph interactively, if you close the browser window rather than hitting back or other activity, it hard-locks the cmdlet requiring a powershell restart. I should be able to cancel via the cancellation keystroke and get my prompt back.
I recommend looking at the Az implementation of Connect-AzAccount which follows the same flow but allows for cancellation via a CancellationToken which is wired to the PS cancel event
I have the same issue.
PS C:\> Get-Module Microsoft.Graph, Microsoft.Graph.Authentication
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Manifest 1.9.6 Microsoft.Graph
Script 1.9.6 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext…}
PS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.4
PSEdition Core
GitCommitId 7.2.4
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
would be good to add. adding to backlog.
should work in the V2 release. Preview of V2 coming soon.
Closed by #1201. Will ship in v2.