Powershell: Cannot paste complete password when creating a new credential

Created on 27 Jul 2018  路  8Comments  路  Source: PowerShell/PowerShell

When running Get-Credential, if I try to paste my password when prompted for a password, it only takes the first character or so then exits the command. The rest of the password is then pasted to the console.

Steps to reproduce

PS C:> "TestPassword123" | clip.exe
PS C:> $cred = Get-Credential

PowerShell credential request
Enter your credentials.
User: Test
Password for user Test: *
PS C:> stPassword123

Expected behavior

When pasting the password into the password prompt, the entire password should be accepted to properly create the credential object

Actual behavior

As single character is pasted to the password field then the command closes and the remainder of the password gets pasted to the console.

Environment data

PS C:> $PSVersionTable

Name Value
---- -----
PSVersion 6.1.0-preview.4
PSEdition Core
GitCommitId 6.1.0-preview.4
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Issue-Discussion Resolution-Answered WG-Interactive-Console

Most helpful comment

I set "Resolution-Answered" because we have no link to PR.

All 8 comments

I'm also seeing this in the stable version as well.

PS C:\Program Files\PowerShell\6.0.3> $PSVersionTable

Name Value
---- -----
PSVersion 6.0.3
PSEdition Core
GitCommitId v6.0.3
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Seems we already have such report.

I tried searching for it but wasn't able to find one. Do you have the issue #?

I can not find too.

Came to see if someone opened an issue for this, saw that @mmcelreath already did! I am seeing this as well. Environment information below.

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 10.0.15063
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@iSazonov / @vexx32 I don't think this is any issue anymore since I'm not able reproduce this on 7.1 rc1. Can this issue be closed?

C:\> "TestPassword123" | clip.exe
C:\> $cred = Get-Credential

PowerShell credential request
Enter your credentials.
User: test
Password for user test: ***************

C:\> $cred.GetNetworkCredential().Password
TestPassword123

Tested and confirmed this works as expected for me as well.

I set "Resolution-Answered" because we have no link to PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

concentrateddon picture concentrateddon  路  3Comments

garegin16 picture garegin16  路  3Comments

manofspirit picture manofspirit  路  3Comments

andschwa picture andschwa  路  3Comments

pcgeek86 picture pcgeek86  路  3Comments