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 sealed 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 remote computer

ConfigurationName

Shell which is executed in the remote machine

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

Methods

ToString()

ToString method override