0
votes

I am editing a build definition to run the latest scripts for our product on the dev database before we run our integration tests... that aside, I'm using a powershell script task for my TFS build definition to do so. The MSBuild step before it is set for x64, and some of the dll's loaded for a build won't work with x86, is there any way to use the arguments or variables for this build step to change the powershell script from x86 to x64? The following lines are the only references to x86 architecture in the script.

$env:Path += ";C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\"

CD "C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn"

1

1 Answers

0
votes

We can not specific arguments or variables to change powershell script from x86 to x64 within the PowerShell task.

However you can run batch/cmd or powershell script to call the specific version of PowerShell.exe:

syswow64 lets you run 32 bit system executables from 64 bit code. And System32 lets you run 64 bit system executables from 32 bit code.

So To specifically use the 32-bit version, call this one from your program:

C:\Windows\SysWoW64\WindowsPowerShell\v1.0\powershell.exe

To use the 64-bit version (on a 64-bit OS), call this one from your program: (Your case )

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Reference below threads: