msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Support Keystoke (ctrl-c) cancellation for Connect-MgGraph

Open JustinGrote opened this issue 3 years ago • 3 comments

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

JustinGrote avatar May 13 '22 16:05 JustinGrote

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

danielniccoli avatar Jun 02 '22 16:06 danielniccoli

would be good to add. adding to backlog.

ddyett avatar Jun 16 '22 15:06 ddyett

should work in the V2 release. Preview of V2 coming soon.

ddyett avatar Jun 16 '22 16:06 ddyett

Closed by #1201. Will ship in v2.

peombwa avatar Oct 18 '22 18:10 peombwa