Skip to content

Remove -NonInteractive from PowerShell startup sequence #3847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

andyleejordan
Copy link
Member

This command-line flag sets a low-level configuration within PowerShell
that prevents Windows PowerShell from using interactive parameters in
scripts (such as in Get-Credential). It does not appear to be
necessary for us to use this flag, so we're going to test without it.

Fixes #3820.

@ghost ghost added the Issue-Bug A bug to squash. label Feb 22, 2022
@andyleejordan andyleejordan marked this pull request as ready for review February 22, 2022 17:39
This command-line flag sets a low-level configuration within PowerShell
that prevents Windows PowerShell from using interactive parameters in
scripts (such as in `Get-Credential`). It does not appear to be
necessary for us to use this flag, so we're going to test without it.
@andyleejordan andyleejordan force-pushed the andschwa/non-interactive branch from b1c1f0b to 2396f7c Compare February 22, 2022 23:01
@andyleejordan
Copy link
Member Author

@SeeminglyScience On PowerShell 5.1 and 7.2.1, the previous bug where the wrong PSReadLine was loaded does not appear to be recurring with this PR. They both loaded the module from the extension path, despite other versions of PSReadLine being available (and loaded in the standalone console).

@andyleejordan
Copy link
Member Author

Screen Shot 2022-02-22 at 3 47 20 PM

Seems to solve the problem!

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

Ahh that's right. -Command/-File should do the same as long as -NoExit isn't present. LGTM!

@andyleejordan andyleejordan merged commit 2fb293c into master Feb 23, 2022
@andyleejordan andyleejordan deleted the andschwa/non-interactive branch February 23, 2022 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get-Credential throws exception instead of prompting for input in PowerShell 5.1
2 participants