PowerTip: Easily Find the PowerShell ApartmentState

Doctor Scripto

Summary: Easily find the Windows PowerShell ApartmentState.

Hey, Scripting Guy! Question How can I easily find the Windows PowerShell ApartmentState?

Hey, Scripting Guy! Answer Use the $host automatic variable, and select the ApartmentState property from the RunSpace object, as shown here.

PS C:\> $Host.RunSpace.ApartmentState

STA

0 comments

Discussion is closed.

Feedback usabilla icon