Bagikan melalui


PSSession Class

Definition

Class that exposes read only properties and which conveys information about a remote runspace object to the user. The class serves the following purpose: 1. Exposes useful information to the user as properties 2. Shields the remote runspace object from directly being exposed to the user. This way, the user will not be able to directly act upon the object, but instead will have to use the remoting cmdlets. This will prevent any unpredictable behavior.

public ref class PSSession sealed
public sealed class PSSession
type PSSession = class
Public NotInheritable Class PSSession
Inheritance
PSSession

Properties

ApplicationPrivateData

Private data to be used by applications built on top of PowerShell. Optionally sent by the remote server when creating a new session / runspace.

Availability

Indicates whether the specified runspace is available for executing commands.

ComputerName

Name of the computer target.

ComputerType

Type of the computer target.

ConfigurationName

Shell which is executed in the remote machine.

ContainerId

Id of the container target.

Id

SessionId of this runspace. This is unique only across a session.

InstanceId

InstanceID that identifies this runspace.

Name

Friendly name for identifying this runspace.

Runspace

The remote runspace object based on which this information object is derived.

Transport

Name of the transport used.

VMId

Guid of the virtual machine target.

VMName

Name of the virtual machine target.

Methods

Create(Runspace, String, PSCmdlet)

Creates a PSSession object from the provided remote runspace object. If psCmdlet argument is non-null, then the new PSSession object is added to the session runspace repository (Get-PSSession).

ToString()

ToString method override.

Applies to