SCCM 2012 is a 32bit client, to run a PowerShell script on a 64bit machine in 64bit processing mode you have to call the powershell.exe with full path.
%winDir%\Sysnative\windowsPowershell\v1.0\Powershell.exe -ExecutionPolicy Bypass -File .\script.ps1