Forum Discussion
Cannot dot-source this command because it was defined in a different language mode.
Hi, Ravi.
If you run the following command, does it show as FullLanguage or another value? (I'm guessing it may be ConstrainedLanguage.)
$ExecutionContext.SessionState.LanguageMode
Incidentally, Name is a read-only attribute on $Host, meaning that won't work anyway.
If you were looking to change the windows title, you need to change $Host.UI.RawUI.WindowTitle:
$Host.UI.RawUI.WindowTitle = "Foo";
Cheers,
Lain
- RaviKiranSOct 03, 2022Former Employee
LainRobertson - Yes, after some research, I also found that. It's in ConstrainedLanguage mode and not in FullLanguage. I am unable to change it to FullLanguage mode. Based on online articles, this will be temporary for the current session but for me it's everywhere and I am unable to change it.
Can you please help me to change it. Thanks!
- raindropsdevOct 03, 2022Iron ContributorHere it says that it's activated automatically when Device Guard is enabled: https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/
Can you try disabling Device Guard and/or Applocker?- RaviKiranSOct 03, 2022Former Employee
raindropsdev - Thanks for your reply. I tried to remove/disable Device Gaurd/App locker
2 Effective Ways to Disable Credential Guard Windows 10 (minitool.com)
Clear AppLocker Policy in Windows 10 | Tutorials (tenforums.com)
Many other ways but still no luck