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.
But your PowerShell console always displays this nasty message:
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
No output is generated in the PowerShell console window… just what we wanted!
Categories: PowerShell
Nice catch. I always wondered how to get rid of this message.