WSManConnectionInfo Class
Collapse the table of content
Expand the table of content

WSManConnectionInfo Class

Provides the connection information that is needed to connect to a remote runspace. Windows PowerShell uses a Windows Remote Management (WinRM) connection to connect to the computer where the remote runspace is opened. This class is introduced in Windows PowerShell 2.0.

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

Dim instance As WSManConnectionInfo

public ref class WSManConnectionInfo sealed : public RunspaceConnectionInfo
public final class WSManConnectionInfo extends RunspaceConnectionInfo
public final class WSManConnectionInfo extends RunspaceConnectionInfo

The following code example describes how to connect to a remote runspace using WSManConnectionInfo.

public void openRunspace(string uri, string schema, string username, string livePass)
            System.Security.SecureString password = new System.Security.SecureString();
            foreach (char c in livePass.ToCharArray())
            PSCredential psc = new PSCredential(username, password);
            WSManConnectionInfo rri = new WSManConnectionInfo(new Uri(uri), schema, psc);
            rri.AuthenticationMechanism = AuthenticationMechanism.Basic;
            Runspace runspace = RunspaceFactory.CreateRunspace(rri);
            Application["runspace"] = runspace;

This class cannot be inherited.


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

© 2015 Microsoft