Share via


PSJob.SessionId Property

Gets the identifier of the PSJob that is unique within a session.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in system.management.automation.dll)

Usage

Syntax

'Declaration
Public ReadOnly Property SessionId As Integer
public int SessionId { get; }
public:
property int SessionId {
    int get ();
}
/** @property */
public int get_SessionId ()
public function get SessionId () : int

Property Value

The identifier of the PSJob that is unique within a session. This is a short hand identifier that can be used to identify the job within the session.

Remarks

There is no guarantee that the same job in another session will have a different session identifier. For example, if a job is running in two runspaces (with two different instance identifiers) they can both have the same session identifier.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP

Target Platforms

Windows Server 2008, Windows Server 2003, Windows Vista, Windows XP

See Also

Reference

PSJob Class
PSJob Members
System.Management.Automation Namespace