PSCredential.Explicit Method

Casts a PSCredential object as a NetworkCredential object.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim input As PSCredential
Dim output As NetworkCredential

output = CType(input, NetworkCredential)

public static explicit operator NetworkCredential (
	PSCredential credential



The PSCredential object to be cast.

Return Value

The appropriate network credential object for the specified PSCredential object. Otherwise, null is returned if the current object has not been initialized or if the current credentials are not compatible with a NetworkCredential object, such as smart card credentials.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
© 2014 Microsoft