You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConstrainedLanguage mode includes the [ScriptBlock] type #13337
In comparison to the RestrictedLanguage mode where "users can run commands, but can't use scriptblocks", ConstrainedLanguage mode does support the [ScriptBlock] type:
$ExecutionContext.SessionState.LanguageMode="ConstrainedLanguage"$ScriptBlock= { 1+2 } # Or even explicit: [ScriptBlock]{ 1 + 2 }Invoke-Command$ScriptBlock# returns: 3
But the [ScriptBlock] type isn't listed under "The following .NET types are permitted in ConstrainedLanguage mode." in the ConstrainedLanguage mode section (even it does contain types along with [ValidateScript] that actually require a scriptblock for the constructor)
Activity