PSCredential Constructors

Definition

Overloads

PSCredential(PSObject)

Initializes a new instance of the PSCredential class with a username and password from PSObject.

PSCredential(String, SecureString)

Initializes a new instance of the PSCredential class with a username and password.

PSCredential(PSObject)

Initializes a new instance of the PSCredential class with a username and password from PSObject.

public:
 PSCredential(System::Management::Automation::PSObject ^ pso);
public PSCredential (System.Management.Automation.PSObject pso);
new System.Management.Automation.PSCredential : System.Management.Automation.PSObject -> System.Management.Automation.PSCredential
Public Sub New (pso As PSObject)

Parameters

pso
PSObject

Applies to

PSCredential(String, SecureString)

Initializes a new instance of the PSCredential class with a username and password.

public:
 PSCredential(System::String ^ userName, System::Security::SecureString ^ password);
public PSCredential (string userName, System.Security.SecureString password);
new System.Management.Automation.PSCredential : string * System.Security.SecureString -> System.Management.Automation.PSCredential
Public Sub New (userName As String, password As SecureString)

Parameters

userName
String

User's name.

password
SecureString

User's password.

Applies to