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