August 20th, 2012

PowerTip: Using Credentials in PowerShell

Doctor Scripto
Scripter

Summary: Learn how to find Windows PowerShell cmdlets and providers that support credentials.

Hey, Scripting Guy! Question How can I find which Windows PowerShell cmdlets support the credential parameter?

Hey, Scripting Guy! Answer Use the Get-Command cmdlet with a command such as:

Get-Command -ParameterName credential

Hey, Scripting Guy! Question How can I find which Windows PowerShell providers support credentials?

Hey, Scripting Guy! Answer Use the Get-PSProvider cmdlet and pipe the results to Where-Object. Then look for credential in the capabilities property. An example for doing this in Windows PowerShell 3.0 is shown here.

Get-PSProvider | where -Property capabilities -Value credential -Match

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.

Feedback