Export (0) Print
Expand All

ConnectPSSessionCommand Class

Connects Windows PowerShell sessions (remote runspaces) that are in the disconnected state and returns those Windows PowerShell session objects in the opened state. One or more session objects can be specified for connecting, or a remote computer name can be specified; in the latter case, all disconnected remote runspaces found on the remote computer are connected and PSSession objects created on the local machine. The cmdlet can be used in the following ways: Connect a PS session object: > $session = New-PSSession serverName > Disconnect-PSSession $session > Connect-PSSession $session Connect a PS session by name: > Connect-PSSession $session.Name Connect a PS session by Id: > Connect-PSSession $session.Id Connect a collection of PS session: > Get-PSSession | Connect-PSSession Connect all disconnected PS sessions on a remote computer > Connect-PSSession serverName


Namespace: Microsoft.PowerShell.Commands
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim instance As ConnectPSSessionCommand

[SuppressMessageAttribute("Microsoft.PowerShell", "PS1012:CallShouldProcessOnlyIfDeclaringSupport")] 
[CmdletAttribute("Connect", "PSSession", SupportsShouldProcess=true, DefaultParameterSetName="Name", HelpUri="http://go.microsoft.com/fwlink/?LinkID=210604", RemotingCapability=RemotingCapability.OwnedByCommand)] 
[OutputTypeAttribute(System.Compiler.TypeNode[])] 
public class ConnectPSSessionCommand : PSRunspaceCmdlet, IDisposable
/** @attribute SuppressMessageAttribute("Microsoft.PowerShell", "PS1012:CallShouldProcessOnlyIfDeclaringSupport") */ 
/** @attribute CmdletAttribute("Connect", "PSSession", SupportsShouldProcess=true, DefaultParameterSetName="Name", HelpUri="http://go.microsoft.com/fwlink/?LinkID=210604", RemotingCapability=RemotingCapability.OwnedByCommand) */ 
/** @attribute OutputTypeAttribute(System.Compiler.TypeNode[]) */ 
public class ConnectPSSessionCommand extends PSRunspaceCmdlet implements IDisposable
SuppressMessageAttribute("Microsoft.PowerShell", "PS1012:CallShouldProcessOnlyIfDeclaringSupport") 
CmdletAttribute("Connect", "PSSession", SupportsShouldProcess=true, DefaultParameterSetName="Name", HelpUri="http://go.microsoft.com/fwlink/?LinkID=210604", RemotingCapability=RemotingCapability.OwnedByCommand) 
OutputTypeAttribute(System.Compiler.TypeNode[]) 
public class ConnectPSSessionCommand extends PSRunspaceCmdlet implements IDisposable

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.
Show:
© 2014 Microsoft