64-bit powershell runner - does it need the build agent to run in 64-bit mode?

I'm trying to run a powershell script in 64-bit mode, but it always runs in 32-bit mode instead.

if ([System.IntPtr]::Size -eq 8)
{
     "Running 64-bit powershell"
}
else
{
    "Running 32-bit powershell, all is lost"
}

I have the "Powershell run mode" set to x64 in the build step, and the build log says

[16:33:59]: [Step 3/5] Using runner: jetbrains_powershell
[16:34:00]: [Step 3/5] Starting: cmd.exe /c  C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe  -NonInteractive -Command -  <C:\BuildAgentA\work\78b6ead776e261b4\AutoRegress\Launcher\RegisterCore.ps1
[16:34:00]: [Step 3/5] in directory: C:\BuildAgentA\work\78b6ead776e261b4\AutoRegress\Launcher\lib
[16:34:00]: [Step 3/5] Running 32-bit powershell, all is lost


[The server is running Windows 2008R2]


it looks to me as though this will get the 32-bit version of Powershell if the build agent itself is running in 32-bit mode. Do I need to change the build agent to use 64-bit java in order to use the 64-bit powershell runner? (and if so, how do I do that?)



Thanks.




Please sign in to leave a comment.