Problem:
PowerShell console runs in Constrained Language mode when using software restriction policies and AppLocker. This means you may get an error when trying to run some scripts.
Solution:
Add a path rule to allow scripts to run in the below:
%OSDRIVE%\USERS\*\APPDATA\LOCAL\TEMP\__PSSCRIPTPOLICYTEST_*