ERROR: Get-InstalledLanguage : Cannot change thread mode after it is set. (Exception from HRESULT: 0x80010106 (RPC_E_CHANGED_MODE))
Powershell Studio 5.8.211.0
Has issues with anything from LanguagePackManagement
PS Studio issues with Get-InstalledLanguage
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PS Studio issues with Get-InstalledLanguage
I'm having a hard time reproducing this behavior:
Can you please provide a screenshot of the application with the error when you attempt to run your script?Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PS Studio issues with Get-InstalledLanguage
So its a form load from a button. I doubled the $languages because sometimes it just wouldnt load them, this has it check to see if its there, and just do it again. (not ideal). This module is brand new as of a month ago so I just assumed PS Studio was having integration issues with it.
$form1_Load={
#TODO: Initialize Form Controls here
$richtextbox1.AppendText("Currently Installed Language Packs")
$languages = Get-InstalledLanguage
if ($languages -eq $null)
{ $languages = Get-InstalledLanguage}
foreach ($l in $languages)
{
$richtextbox1.AppendText("`n$($l.languageid)")
}
$progressbaroverlay1.Visible = $false
}
$form1_Load={
#TODO: Initialize Form Controls here
$richtextbox1.AppendText("Currently Installed Language Packs")
$languages = Get-InstalledLanguage
if ($languages -eq $null)
{ $languages = Get-InstalledLanguage}
foreach ($l in $languages)
{
$richtextbox1.AppendText("`n$($l.languageid)")
}
$progressbaroverlay1.Visible = $false
}
- Attachments
-
- languages.JPG (63.97 KiB) Viewed 1471 times
Re: PS Studio issues with Get-InstalledLanguage
The issue appears to only happen when using the LanguagePackManagement module with a GUI or WinForm. I've tested this in Visual Studio Code and ISE, but it results in the same error. Basic scripts appear to run fine. My guess is that this module has conflict with a GUI's thread.
While this may change in a update to the module, it might be a good idea to report this to Microsoft.
While this may change in a update to the module, it might be a good idea to report this to Microsoft.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.