Powershell workflow is not supported in powershell 32bit mode. Thus i want to execute the script using powershell 64bit mode.How to run .ps1 script in 64bit mode via jenkins?
Asked
Active
Viewed 1,705 times
1
-
1Don't know about Jenkins specifically, but if you can launch a whole command line, you can launch 64-bit PowerShell from a 32-bit process, such as in the following example: `c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -c "get-date; (Get-Item Env:ProgramFiles).Value"` – mklement0 Jan 20 '20 at 13:47
-
try running the following StackOverflow search >>> `[jenkins] run 64 bit powershell` <<< [*grin*] – Lee_Dailey Jan 20 '20 at 14:23
3 Answers
0
You could create your custom powershell step like in this stackoverflow answer
Executing powershell command directly in jenkins pipeline
You'll have to replace powershell.exe by the path to your powershell 64b exe
You could also use a shebang. some literature on that at How can I use a shebang in a PowerShell script?

fredericrous
- 2,833
- 1
- 25
- 26
0
it works by calling using c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe instead of c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
find more information about sysnative at https://www.thewindowsclub.com/sysnative-folder-in-windows-64-bit

Sankaranand
- 89
- 8
0
I confirm that calling:
%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy Unrestricted -file "%~dp0\file.ps1"
results in the 64 bit powershell.
One can validate inside their script by printing out debug of:
$GE_64BitPS_Status=[System.Environment]::Is64BitProcess
write-host $GE_64BitPS_Status

logi-kal
- 7,107
- 6
- 31
- 43