This script will set an environment variable on the system to enable PowerShell Constrained Language Mode.
This can also be achieved using Microsoft GPP to implement and Environment Variable.
Open up PowerShell as an Administrator on the system you wish to lock and run the below commands. Be sure to restart all PowerShell sessions after you have run the script.
[Environment]::SetEnvironmentVariable('__PSLockdownPolicy', 4, 'Machine')