![]() ![]() To determine whether a Windows PowerShell host program is running in STA mode, use this command to check the value of the ApartmentState property: $host. Windows PowerShell ISE always runs in STA mode. If you are using Windows PowerShell 2.0, use the following command to start Windows PowerShell with the STA option: Starting in Windows PowerShell 3.0, the Windows PowerShell console runs in STA mode by default. If you add the following comment to your script, PowerShell Studio and PrimalScript run the script in STA mode: # %ForceSTA% = True Next, make sure that your Windows PowerShell scripts require STA when running. ![]() But, when you package a script, be sure to retain the STA mode settings.Ĭlick Deploy and in the Packager section, click Settings and then Engine Settings. Luckily, PowerShell Studio detects when your form includes an STA mode dependent control and runs it in STA mode. For example: :: SetText( "Paste this text to the clipboard" ) Packaging and STA mode:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |