Creates a new PSCredential
object from a given username and password.
New-Credential [-User] <String> [-Password] <String> [<CommonParameters>]
Many PowerShell commands require a PSCredential
object instead of username/password. This function will create one for you.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
User | String | The username. | true | false | |
Password | String | The password. | true | false |
System.Management.Automation.PSCredential.
New-Credential -User ENTERPRISE\picard -Password 'earlgrey'
Creates a new credential object for Captain Picard.