다음을 통해 공유


PSCredential.Explicit(PSCredential to NetworkCredential) Operator

Definition

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

public:
 static explicit operator System::Net::NetworkCredential ^(System::Management::Automation::PSCredential ^ credential);
public static explicit operator System.Net.NetworkCredential (System.Management.Automation.PSCredential credential);
static member op_Explicit : System.Management.Automation.PSCredential -> System.Net.NetworkCredential
Public Shared Narrowing Operator CType (credential As PSCredential) As NetworkCredential

Parameters

credential
PSCredential

PSCredential to convert.

Returns

null if the current object has not been initialized. null if the current credentials are incompatible with a NetworkCredential -- such as smart card credentials. the appropriate network credential for this PSCredential otherwise.

Applies to