PSThreadOptions PSThreadOptions PSThreadOptions PSThreadOptions Enum

Definition

These options control whether a new thread is created when a command is executed within a runspace

public enum class PSThreadOptions
public enum PSThreadOptions
type PSThreadOptions = 
Public Enum PSThreadOptions
Inheritance
PSThreadOptionsPSThreadOptionsPSThreadOptionsPSThreadOptions

Fields

Default Default Default Default 0

Use the default options: UseNewThread for local Runspace, ReuseThread for local RunspacePool, server settings for remote Runspace and RunspacePool

ReuseThread ReuseThread ReuseThread ReuseThread 2

Creates a new thread for the first invocation and then re-uses that thread in subsequent invocations.

UseCurrentThread UseCurrentThread UseCurrentThread UseCurrentThread 3

Doesn't create a new thread; the execution occurs on the thread that calls Invoke.

UseNewThread UseNewThread UseNewThread UseNewThread 1

Creates a new thread for each invocation

Applies to