1

I'm trying to run a PowerShell script using the Jenkins PowerShell plugin and the script produces the following error:
"ERROR: The target system must be running a 32 bit OS"

The slave runs on a Windows 2008 R2 Server and the script runs well locally and remotely from my Windows 7/x64 desktop but it won't run through the plugin.
I also tried to run it using a Windows batch command plugin and that wouldn't work either - same error message.
I narrowed the issue and found the line that produces the error:

 $results = openfiles /query /fo csv | Select-String $versionPath

It looks like the OPENFILES command causes the problem and i think it is because Jenkins starts the x86 version of PowerShell but i'm not sure what needs to be done so it will run on the right CPU architecture.

Any help will be appreciated.

2
  • C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -> x64 C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -> x32 Try staring the second one Commented Jul 22, 2014 at 12:12
  • I tried with both. It looks like Jenkins goes to the x86 version of PowerShell when running the PowerShell plugin and to the x86 version of CMD when running the Windows batch plugin. If i call the script directly from the x86 version of CMD i get the same error message. Commented Jul 22, 2014 at 12:51

1 Answer 1

2

Like i thought, Jenkins is running the jobs using the x86 versions of CMD and PowerShell. To get them running using their x64 versions i had to run the slave with the x64 version of Java.

The following solution came much later but that's the best way to go:

  1. Make sure you don't have any x86 versions of Java installed on your server. If you have 32bit Java versions installed, Jenkins slave will use these versions to run your jobs. x64 versions of Java can be downloaded here.
  2. Start the x64 version of Internet Explorer on your server and go to the 'Manage Nodes' page in Jenkins to install the slave on your server.
  3. Finally - install the slave as a Windows Service.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.