Dela via


PSCredential Class

Definition

Offers a centralized way to manage usernames, passwords, and credentials.

public ref class PSCredential sealed : System::Runtime::Serialization::ISerializable
[System.Serializable]
public sealed class PSCredential : System.Runtime.Serialization.ISerializable
public sealed class PSCredential : System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type PSCredential = class
    interface ISerializable
type PSCredential = class
    interface ISerializable
Public NotInheritable Class PSCredential
Implements ISerializable
Inheritance
PSCredential
Attributes
Implements

Constructors

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.

Properties

Empty

Gets an empty PSCredential. This is an PSCredential with both UserName and Password initialized to null.

GetSymmetricEncryptionKeyDelegate

Gets or sets a delegate which returns the encryption key and initialization vector for symmetric encryption algorithm.

Password

User's password.

UserName

User's name.

Methods

GetNetworkCredential()

Returns an equivalent NetworkCredential object for this PSCredential.

A null is returned if -- current object has not been initialized -- current creds are not compatible with NetworkCredential (such as smart card creds or cert creds)

GetObjectData(SerializationInfo, StreamingContext)

GetObjectData.

Operators

Explicit(PSCredential to NetworkCredential)

Provides an explicit cast to get a NetworkCredential from this PSCredential.

Applies to