PSThreadOptions Enumeration
Defines how threads are created and used when a command is executed within a runspace. This enumeration is introduced in Windows PowerShell 2.0.
Namespace: System.Management.Automation.Runspaces
Assembly: System.Management.Automation (in System.Management.Automation.dll)
PowerShell
Namespace: System.Management.Automation.Runspaces
Assembly: System.Management.Automation (in System.Management.Automation.dll)
| Member name | Description |
|---|---|
| Default | On the local computer, operates through UseNewThread for runspaces and ReuseThread for runspace pools. Server settings are used for remote runspaces and runspace pools. This field is introduced in Windows PowerShell 2.0. |
| ReuseThread | Creates a new thread for the first invocation and then re-uses that thread in subsequent invocations. This field is introduced in Windows PowerShell 2.0. |
| UseCurrentThread | Executes on the thread that called the Invoke method. This option is not valid for asynchronous calls. This field is introduced in Windows PowerShell 2.0. |
| UseNewThread | Creates a new thread for each invocation. This field is introduced in Windows PowerShell 2.0. |
Target Platforms
Windows 98, Windows 2000 , Windows 2000 Server , Windows CE, Windows Server 2008, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional, Windows Vista, Windows Server 2003 R2, Windows XP, Windows 7, Windows 2008 R2, Windows Developer Preview, Windows Server Developer PreviewReference
System.Management.Automation.Runspaces NamespacePowerShell
Other Resources
Windows PowerShell SDKSend comments about this topic to Microsoft.