PowerShell Constrained Language is a language mode of PowerShell designed to restrict access to sensitive language elements that can be used to invoke arbitrary Windows APIs.
To view current parameter level, use the command:
$ExecutionContext.SessionState.LanguageMode
To set Constrained Language, use the command:
$ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"
To set the parameter for future sessions, use the following command within an elevated prompt:
[Environment]::SetEnvironmentVariable('__PSLockdownPolicy', '4', 'Machine')
https://blogs.msdn.microsoft.com/powershell/2017/11/02/powershell-constrained-language-mode/
https://itfordummies.net/2015/06/01/powershell-constrained-mode/
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.