Not rendering correctly, using Nerd Fonts #5855
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@JayG30 try forcing PowerShell to UTF8. This could be the issue. |
Beta Was this translation helpful? Give feedback.
-
I figured out the issue. Powershell was launching in ConstrainedLanguage mode. I've used this PC over the years to create and test system application control policies through AppLocker, SRP, and Windows Defender Application Control (WDAC) for my job. And while it at least appeared I had removed and wasn't enforcing anything, there were still things lingering on the system which by design Powershell automatically detects and puts you into ConstrainedLanguage mode. There is no way to switch to FullLanguage mode without removing or creating rules to allow it. This website HERE provided some clarity that AppLocker was the culprit. When you launch powershell it creates a script in $env:temp and tries to run it. If it fails it puts you into ConstrainedLanguage mode. More importantly you will see in Event Viewer an ERROR from AppLocker. I had already done this, but you can remove AppLocker rules by using local group policy, navigate to AppLocker, right click and clear policy. This will remove all rules and set everything to disabled. What went wrong for me was that I did this while the window service "Application Identity" was not running (disabled by default). This service is requires to create AND delete AppLocker rules. This is explained in the Microsoft documentation HERE. If you clear the policy through GPO while this is NOT enabled you have to go into C:\Windows\System32\AppLocker and delete the files. The reason this works when you "run as Administrator" is because the AppLocker policies are typically setup by default to exclude this built-in account. Now that I'm not stuck in ConstrainedLanguage mode it works. |
Beta Was this translation helpful? Give feedback.
I figured out the issue. Powershell was launching in ConstrainedLanguage mode.
I will leave this here for others.
I've used this PC over the years to create and test system application control policies through AppLocker, SRP, and Windows Defender Application Control (WDAC) for my job. And while it at least appeared I had removed and wasn't enforcing anything, there were still things lingering on the system which by design Powershell automatically detects and puts you into ConstrainedLanguage mode. There is no way to switch to FullLanguage mode without removing or creating rules to allow it.
This website HERE provided some clarity that AppLocker was the culprit. When you launch powershell …