Skip to content

Run PowerShell script in MicrosoftGraphTokenProvider in interactive mode#142

Merged
pontemonti merged 2 commits intomainfrom
users/johanb/ExecutePowershellAsyncInteractive
Jan 7, 2026
Merged

Run PowerShell script in MicrosoftGraphTokenProvider in interactive mode#142
pontemonti merged 2 commits intomainfrom
users/johanb/ExecutePowershellAsyncInteractive

Conversation

@pontemonti
Copy link
Contributor

Update ExecutePowerShellAsync in MicrosoftGraphTokenProvider to always run in interactive mode.

This addresses the issue reported in #131

@pontemonti pontemonti requested a review from a team as a code owner January 6, 2026 17:31
Copilot AI review requested due to automatic review settings January 6, 2026 17:31
@pontemonti pontemonti requested a review from a team as a code owner January 6, 2026 17:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the PowerShell execution logic in MicrosoftGraphTokenProvider by removing the conditional execution paths based on the useDeviceCode parameter. All token acquisition flows now consistently use interactive streaming mode, addressing issue #131.

Key Changes

  • Removed the useDeviceCode parameter from internal methods ExecuteWithFallbackAsync and ExecutePowerShellAsync
  • Eliminated conditional logic that switched between ExecuteAsync (for browser flow) and ExecuteWithStreamingAsync (for device code flow)
  • Now always uses ExecuteWithStreamingAsync with interactive: true for all authentication flows

sellakumaran
sellakumaran previously approved these changes Jan 6, 2026
@pontemonti pontemonti merged commit 915a92d into main Jan 7, 2026
5 checks passed
@pontemonti pontemonti deleted the users/johanb/ExecutePowershellAsyncInteractive branch January 7, 2026 22:06
sellakumaran pushed a commit that referenced this pull request Feb 27, 2026
…ode (#142)

* Update ExecutePowerShellAsync in MicrosoftGraphTokenProvider to always run in interactive mode.

* Update tests

---------

Co-authored-by: Johan Broberg <johanb@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants