PowerShell’s Get-Credential cmdlet lets us create a secure credential object for a specified user name and password using a UI dialog:
| 
1 | PS> Get-Credentialshay | 
| 
1 
2 | $key= "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds"Set-ItemProperty-Path$key-NameConsolePrompting -Value$true | 
| 
1 
2 
3 
4 
5 | PS> Get-CredentialshayWindows PowerShell Credential RequestEnter your credentials.Password for user shay: ******** | 
