How to run PowerShell remotely in 32-bit(!) mode

I need a way to execute a PowerShell script remotely but the script has to be executed by the 32-bit version of the PowerShell. How can I achieve this?

Here is a test script that 

if ([System.IntPtr]::Size -eq 4) {
   Write-Host "Script is execute by x86 version of PowerShell."
}

I already tried the following javascript placed in the BeforeAction event but with no success:

var opt = GetOptionsObject("Windows PowerShell");
if (opt) {
  opt.Properties.PropertyAsString("PowershellLocation") = "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe";
}

It seems that this will work only, if the script is executed locally, right?

Any ideas?

Kind regards,
Marcus

Hi Marcus

We don’t have any built in support for remote powershell execution. The only suggestion I can give is to use the psExec action, but you will need to get the script file onto the remote machine first.

Any powershell script that finalbuilder executes is running locallly.