Security Focus: Set ConstrainedLanguage Mode on My Test Computer

Whilst doing some research, for a presentation on Security and PowerShell, I came across what I assume is an UNSUPPORTED setting, due to a lack of documentation:

[Environment]::SetEnvironmentVariable('__PSLockdownPolicy', '4', 'Machine')


After running it, look what happens when I try and start PowerShell. Damn, my profile script won't run… but, what's this? I can't do other stuff, too? Damn!



If you've never come across ConstrainedLanguage mode, it does exactly that… it constrains the PowerShell language.



Comments (0)

Skip to main content