Running Powershell 64bit
Posted: Tue Nov 19, 2024 12:52 pm
Hi, I'm really hopeful that this is an easy question, but it has been driving me nuts for days:
I need to run a PowerShell script using the 64bit version of powershell.exe
Even if I explicitly run the program from the folder location:
c:\windows\syswow64\WindowsPowerShell\v1.0\powershell.exe
My installer appears to use the 32 bit version. I check for the PS version in my script, using the command :
if([IntPtr]::size -eq 8 ) { Write-Host 'x64' } else { Write-Host 'x86' }
It returns 'x86' when run from the installer and 'x64' when run from the command line.
I have added the following command as the first line of my install code but it seems to make no difference:
Set x64 - Native 64 bit Windows, AMD64, EM64T, and ARM64 Architectures - installation mode
Please advise,
Thank you,
Paul
I need to run a PowerShell script using the 64bit version of powershell.exe
Even if I explicitly run the program from the folder location:
c:\windows\syswow64\WindowsPowerShell\v1.0\powershell.exe
My installer appears to use the 32 bit version. I check for the PS version in my script, using the command :
if([IntPtr]::size -eq 8 ) { Write-Host 'x64' } else { Write-Host 'x86' }
It returns 'x86' when run from the installer and 'x64' when run from the command line.
I have added the following command as the first line of my install code but it seems to make no difference:
Set x64 - Native 64 bit Windows, AMD64, EM64T, and ARM64 Architectures - installation mode
Please advise,
Thank you,
Paul