Apparently C:\Windows\system32\cmd.exe
actually runs C:\Windows\SysWOW64\cmd.exe
when launched from a 32-bit environment.
Thus, as Bill Stewart and Ilya Kurnosov suggested, you'll have to adjust the execution policy for your 32-bit PowerShell. There are 3 ways to do this:
Set the execution policy globally with a system or domain policy. However, this route doesn't seem viable for you, since you said you don't have admin privileges on the server in question.
Set the execution policy per-user by manually starting
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
on the server and running the commandSet-ExecutionPolicy RemoteSigned
. This must be done for each user and won't work if the excution policy is locked with a group policy (see above).Bypass the execution policy on the command line by adding
-ExecutionPolicy Bypass
to the PowerShell call infile.bat
:powershell.exe -ExecutionPolicy Bypass -NoLogo -File file.ps1