Home > PowerShell > Suppress “Supply values for the following parameters: Credential” when using Get-Credential in PowerShell

Suppress “Supply values for the following parameters: Credential” when using Get-Credential in PowerShell

When you want to ask the user for alternative credentials, the Get-Credential cmdlet is your friend.

You get a nice popup, asking you for a username and password.

image

But your PowerShell console always displays this nasty message:

image

Basically, this message pops up because the –Credential parameter is not supplied.  Whatever you supply as –Credential, will automatically be filled in as the User Name in the dialog box.  If you want to leave the User Name field blank, just pass the $null value and you’re set.

Get-Credential -Credential $null

 

image

No output is generated in the PowerShell console window… just what we wanted!

Categories: PowerShell
  1. August 4, 2011 at 13:25

    Nice catch. I always wondered how to get rid of this message.

  1. No trackbacks yet.

Leave a comment