If you try to run a script or command in PowerShell and see an error like "only core types in this language mode", then you know you're operating in a restricted environment. If you can find an AppLocker bypass to execute arbitrary code, you can also break out of PowerShell Constrained Language Mode by using an unmanaged PowerShell runspace. If you have a Beacon running on a target, this is just what powerpick does.
This can also be done in C# (using MSBuild as the example again).