Quantcast
Viewing all articles
Browse latest Browse all 36188

PowerTip: Store PowerShell Credentials

 

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

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Question
 How can I store alternate credentials for repeated use in my Windows PowerShell session?

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Answer
Use the Get-Credential cmdlet to prompt for a credential, and store the results in a variable:

$credential = Get-Credential

 Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 36188

Trending Articles