Get-Credentials fails to open a prompt for password on 1.15.2713 (Windows 11) #18585

Closed
opened 2026-01-31 06:18:27 +00:00 by claunia · 20 comments
Owner

Originally created by @PrzemyslawKlys on GitHub (Oct 2, 2022).

Originally assigned to: @DHowett on GitHub.

Windows Terminal version

1.15.2713.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

Open Terminal and type Get-Credential

Expected Behavior

Prompt for password to enter

Actual Behavior

Throws an error message:

image

Get-Credential : Cannot process command because of one or more missing mandatory parameters: Credential.
At line:1 char:1
+ Microsoft.PowerShell.Security\Get-Credential
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Credential], ParameterBindingException
    + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.PowerShell.Commands.GetCredentialCommand

Works fine when using 1.16.2642.0 or using PowerShell 7. The difference being is that PowerShell 7 doesn't open outside window, and PowerShell 5.1 triggers an external window which is why there may be an issue.

Here's how it looks when working (in 1.16.2642.0)

image
image

Originally created by @PrzemyslawKlys on GitHub (Oct 2, 2022). Originally assigned to: @DHowett on GitHub. ### Windows Terminal version 1.15.2713.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce Open Terminal and type Get-Credential ### Expected Behavior Prompt for password to enter ### Actual Behavior Throws an error message: ![image](https://user-images.githubusercontent.com/15063294/193476411-00b73c20-1010-4fd9-be1c-a61d1fbe2136.png) ```powershell Get-Credential : Cannot process command because of one or more missing mandatory parameters: Credential. At line:1 char:1 + Microsoft.PowerShell.Security\Get-Credential + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-Credential], ParameterBindingException + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.PowerShell.Commands.GetCredentialCommand ``` Works fine when using 1.16.2642.0 or using PowerShell 7. The difference being is that PowerShell 7 doesn't open outside window, and PowerShell 5.1 triggers an external window which is why there may be an issue. Here's how it looks when working (in 1.16.2642.0) ![image](https://user-images.githubusercontent.com/15063294/193476459-0d1fd214-b599-459b-af04-114525e12d21.png) ![image](https://user-images.githubusercontent.com/15063294/193476481-779b933b-2dba-48a5-8dfe-e0bcd73866db.png)
claunia added the Issue-BugResolution-ExternalProduct-TerminalArea-DefApp labels 2026-01-31 06:18:27 +00:00
Author
Owner

@mruncleleon commented on GitHub (Oct 4, 2022):

Same here with 1.15.2713.0 in Windows 11 Pro.

If you open Out-GridView first then Get-Credential it works

image

@mruncleleon commented on GitHub (Oct 4, 2022): Same here with 1.15.2713.0 in Windows 11 Pro. If you open Out-GridView first then Get-Credential it works ![image](https://user-images.githubusercontent.com/39353882/193813606-ecbf4a5e-25f7-4ca9-ae78-3c9c511b360e.png)
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2022):

Did you launch the Terminal by running PowerShell, causing a Terminal window to appear/? Or did you launch Terminal directly? I think there's another thread around here about how this is broken for the first terminal launch after a reboot...

@zadjii-msft commented on GitHub (Oct 5, 2022): Did you launch the Terminal by running PowerShell, causing a Terminal window to appear/? Or did you launch Terminal directly? I think there's another thread around here about how this is broken for the _first_ terminal launch after a reboot...
Author
Owner

@PrzemyslawKlys commented on GitHub (Oct 5, 2022):

Launch terminal with PowerShell - fails!
Launch terminal by typing terminal - works!

But it doesn't matter whether this is just right after reboot or not.

@PrzemyslawKlys commented on GitHub (Oct 5, 2022): Launch terminal with PowerShell - fails! Launch terminal by typing terminal - works! But it doesn't matter whether this is just right after reboot or not.
Author
Owner

@carlos-zamora commented on GitHub (Oct 5, 2022):

Yup! Finally got a repro. Important step is to use defterm. So...

  • open run
  • type powershell.exe (opens in WT)
  • type get-credential
    Error!

EDIT: Regardless of first launch

@carlos-zamora commented on GitHub (Oct 5, 2022): Yup! Finally got a repro. Important step is to use defterm. So... - open run - type powershell.exe (opens in WT) - type get-credential Error! EDIT: Regardless of first launch
Author
Owner

@HeinziAT commented on GitHub (Mar 22, 2023):

We currently have this issue with a script started with a "...\path\to\powershell.exe ...\path\to\script.ps1" shortcut.

In case anyone else needs this: The workaround we found was to prefix the command line in the shortcut with wt.exe, e.g. "wt.exe ...\path\to\powershell.exe ...\path\to\script.ps1".

@HeinziAT commented on GitHub (Mar 22, 2023): We currently have this issue with a script started with a "...\path\to\powershell.exe ...\path\to\script.ps1" shortcut. In case anyone else needs this: The workaround we found was to prefix the command line in the shortcut with wt.exe, e.g. "wt.exe ...\path\to\powershell.exe ...\path\to\script.ps1".
Author
Owner

@zadjii-msft commented on GitHub (Apr 12, 2023):

The dotnet api for getting a process's main window iterates over all the top-level windows to find a top-level, visible window. The ConPTY tool window is not top-level (it has an owner). So this is something we actually can't fix on our side. It would require a dotnet foundation fix, which won't happen, because that's not really maintained anymore (in favor of dotnet core).

I'd lean towards closing this. @DHowett did more investigation here. ACK?

@zadjii-msft commented on GitHub (Apr 12, 2023): The dotnet api for getting a process's main window iterates over all the top-level windows to find a top-level, visible window. The ConPTY tool window is _not_ top-level (it has an owner). So this is something we actually can't fix on our side. It would require a dotnet foundation fix, which won't happen, because that's not really maintained anymore (in favor of dotnet core). I'd lean towards closing this. @DHowett did more investigation here. ACK?
Author
Owner

@HeinziAT commented on GitHub (Apr 13, 2023):

If you can't fix the underlying issue on your side, is it possible to at least improve the (misleading) error message?

E.g. instead of

Cannot process command because of one or more missing mandatory parameters: Credential.

it would be nice to have something like

Cannot open credentials window due to complex reasons outside our control. Please provide a Credential parameter or see https://github.com/microsoft/terminal/issues/14119 for details and possible workarounds, if an interactive prompt is required.

@HeinziAT commented on GitHub (Apr 13, 2023): If you can't fix the underlying issue on your side, is it possible to at least improve the (misleading) error message? E.g. instead of > Cannot process command because of one or more missing mandatory parameters: Credential. it would be nice to have something like > Cannot open credentials window due to complex reasons outside our control. Please provide a `Credential` parameter or see `https://github.com/microsoft/terminal/issues/14119` for details and possible workarounds, if an interactive prompt is required.
Author
Owner

@Varusal commented on GitHub (Apr 14, 2023):

Same here with 1.15.2713.0 in Windows 11 Pro.

If you open Out-GridView first then Get-Credential it works

image

Can confirm this is so far the only way I can open the credential prompt.
Also after that, you can open a new tab and even a new terminal window and Get-Credential works.

@Varusal commented on GitHub (Apr 14, 2023): > Same here with 1.15.2713.0 in Windows 11 Pro. > > If you open Out-GridView first then Get-Credential it works > > ![image](https://user-images.githubusercontent.com/39353882/193813606-ecbf4a5e-25f7-4ca9-ae78-3c9c511b360e.png) Can confirm this is so far the only way I can open the credential prompt. Also after that, you can open a new tab and even a new terminal window and `Get-Credential` works.
Author
Owner

@jborean93 commented on GitHub (Apr 20, 2023):

See https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766 for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.

@jborean93 commented on GitHub (Apr 20, 2023): See https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766 for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.
Author
Owner

@Varusal commented on GitHub (Apr 22, 2023):

See #11847 (comment) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.

Or just run Out-GridView once.
After that Get-Credential works even after rebooting and cold start.

@Varusal commented on GitHub (Apr 22, 2023): > See [#11847 (comment)](https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window. Or just run `Out-GridView` **once**. After that `Get-Credential` works even after rebooting and cold start.
Author
Owner

@jeroenebus commented on GitHub (Apr 22, 2023):

See #11847 (comment) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.

Or just run Out-GridView once. After that Get-Credential works even after rebooting and cold start.

Thanks, only don't understand what kind of sorcery this is! 😄

@jeroenebus commented on GitHub (Apr 22, 2023): > > See [#11847 (comment)](https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window. > > Or just run `Out-GridView` **once**. After that `Get-Credential` works even after rebooting and cold start. Thanks, only don't understand what kind of sorcery this is! 😄
Author
Owner

@GeorgievGG commented on GitHub (May 22, 2023):

If you can't fix the underlying issue on your side, is it possible to at least improve the (misleading) error message?

E.g. instead of

Cannot process command because of one or more missing mandatory parameters: Credential.

it would be nice to have something like

Cannot open credentials window due to complex reasons outside our control. Please provide a Credential parameter or see https://github.com/microsoft/terminal/issues/14119 for details and possible workarounds, if an interactive prompt is required.

There needs to be a sensible message, but yours is not entirely correct. If you don't add a password to the "Credential" parameter - you also need prompt and it still causes the same problem.

I'm not sure if the "Credential" being required parameter is an attempt to address the problems with prompt, but if it is - Microsoft failed to anticipate all the scenarios.

@GeorgievGG commented on GitHub (May 22, 2023): > If you can't fix the underlying issue on your side, is it possible to at least improve the (misleading) error message? > > E.g. instead of > > > Cannot process command because of one or more missing mandatory parameters: Credential. > > it would be nice to have something like > > > Cannot open credentials window due to complex reasons outside our control. Please provide a `Credential` parameter or see `https://github.com/microsoft/terminal/issues/14119` for details and possible workarounds, if an interactive prompt is required. There needs to be a sensible message, but yours is not entirely correct. If you don't add a password to the "Credential" parameter - you also need prompt and it still causes the same problem. I'm not sure if the "Credential" being required parameter is an attempt to address the problems with prompt, but if it is - Microsoft failed to anticipate all the scenarios.
Author
Owner

@GeorgievGG commented on GitHub (May 22, 2023):

See #11847 (comment) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.

Or just run Out-GridView once. After that Get-Credential works even after rebooting and cold start.

What do you mean by that?

As soon as I close the GridView, the prompt stops being able to show up.

@GeorgievGG commented on GitHub (May 22, 2023): > > See [#11847 (comment)](https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window. > > Or just run `Out-GridView` **once**. After that `Get-Credential` works even after rebooting and cold start. What do you mean by that? As soon as I close the GridView, the prompt stops being able to show up.
Author
Owner

@Varusal commented on GitHub (Jun 4, 2023):

See #11847 (comment) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window.

Or just run Out-GridView once. After that Get-Credential works even after rebooting and cold start.

What do you mean by that?

As soon as I close the GridView, the prompt stops being able to show up.

Hi @GeorgievGG, really? That's odd.
I literally only had to enter Out-GridView once.

Also on a different device with Terminal version 1.12.10983.0 installed and Get-Credential works without workaround.

Edit: Tested it with Terminal version 1.17.230526001 and PowerShell version 5.1.22621.1778 > Works without workaround.
Edit 2: No more UI with PSVersion 7.3.4
image

@Varusal commented on GitHub (Jun 4, 2023): > > > See [#11847 (comment)](https://github.com/microsoft/terminal/issues/11847#issuecomment-1402554766) for a workaround that gets PowerShell to prompt for the credential using the command line rather than through a credui window. > > > > > > Or just run `Out-GridView` **once**. After that `Get-Credential` works even after rebooting and cold start. > > What do you mean by that? > > As soon as I close the GridView, the prompt stops being able to show up. Hi @GeorgievGG, really? That's odd. I literally only had to enter `Out-GridView` once. Also on a different device with Terminal version 1.12.10983.0 installed and `Get-Credential` works without workaround. Edit: Tested it with Terminal version 1.17.230526001 and PowerShell version 5.1.22621.1778 > Works without workaround. Edit 2: No more UI with PSVersion 7.3.4 ![image](https://github.com/microsoft/terminal/assets/10616926/c38e93a5-e0d1-4c50-8f55-c7f29a0fb323)
Author
Owner

@skrysm commented on GitHub (Jun 12, 2023):

I got stomped today by this issue and I'm still seeing it in version 1.17.11461.0 (which makes me wonder why this would have worked in 1.16).

I'm using something slightly different ($host.ui.PromptForCredential()) but it's basically the same thing.

@skrysm commented on GitHub (Jun 12, 2023): I got stomped today by this issue and I'm still seeing it in version 1.17.11461.0 (which makes me wonder why this would have worked in 1.16). I'm using something slightly different (`$host.ui.PromptForCredential()`) but it's basically the same thing.
Author
Owner

@robmarkoski commented on GitHub (Jul 13, 2023):

So this really had me questioning my sanity.

But yes using 1.17 it wont show get-credential if running from existing terminal.
in the script i am using i needed to use
Start-Process wt -ArgumentList "powershell -File script_with_credential.ps1" to get it working

@robmarkoski commented on GitHub (Jul 13, 2023): So this really had me questioning my sanity. But yes using 1.17 it wont show get-credential if running from existing terminal. in the script i am using i needed to use Start-Process wt -ArgumentList "powershell -File script_with_credential.ps1" to get it working
Author
Owner

@GUREYESO commented on GitHub (Sep 21, 2023):

I had the same issue, restarted Powershell, and connected to AZ-Account again, and is working:

image

@GUREYESO commented on GitHub (Sep 21, 2023): I had the same issue, restarted Powershell, and connected to AZ-Account again, and is working: ![image](https://github.com/microsoft/terminal/assets/103212510/a63c6a14-3d8f-46e5-9aea-73ed1bd91c39)
Author
Owner

@zadjii-msft commented on GitHub (Oct 4, 2023):

Looping back on this:

This is something we actually can't fix on our side. It would require a dotnet foundation fix, which won't happen, because that's not really maintained anymore (in favor of dotnet core).

Since this is kinda at an impasse blocked on this old version of dotnet, we're going to close this out on our side. Thanks everyone

@zadjii-msft commented on GitHub (Oct 4, 2023): Looping back on this: > This is something we actually can't fix on our side. It would require a dotnet foundation fix, which won't happen, because that's not really maintained anymore (in favor of dotnet core). Since this is kinda at an impasse blocked on this old version of dotnet, we're going to close this out on our side. Thanks everyone
Author
Owner

@Pxtl commented on GitHub (Oct 27, 2025):

So... the "powershell" command in the start menu is just kinda broken in Windows 11? And will remain so until Powershell Core becomes the default powershell version (which will never happen because the posh team has figured out it's way easier to make a scripting language when you don't have actual users). Ditto for launching "powershell.exe" from the run bar...

I mean there's an obvious workaround (launch the terminal) but having that gotcha sitting in the start menu is crazy. Is there any team that can update the windows "powershell" OS shortcut to point directly to the terminal instead of that landmine? Is there somewhere else I can report that issue if it can't be fixed there?

@Pxtl commented on GitHub (Oct 27, 2025): So... the "powershell" command in the start menu is just kinda broken in Windows 11? And will remain so until Powershell Core becomes the default powershell version (which will never happen because the posh team has figured out it's way easier to make a scripting language when you don't have actual users). Ditto for launching "powershell.exe" from the run bar... I mean there's an obvious workaround (launch the terminal) but having that gotcha sitting in the start menu is crazy. Is there any team that can update the windows "powershell" OS shortcut to point directly to the terminal instead of that landmine? Is there somewhere else I can report that issue if it can't be fixed there?
Author
Owner
@cachius commented on GitHub (Dec 4, 2025): Backlink: https://superuser.com/questions/1885304/powershell-exe-does-not-prompt-for-credentials/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18585