March 26th, 2013

PowerTip: Store PowerShell Credentials

Doctor Scripto
Scripter

 

Summary: Store your Windows PowerShell credentials in a variable for later use.

Hey, Scripting Guy! Question How can I store alternate credentials for repeated use in my Windows PowerShell session?

Hey, Scripting Guy! AnswerUse the Get-Credential cmdlet to prompt for a credential, and store the results in a variable:

$credential = Get-Credential

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.