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
Running Powershell 64bit
Re: Running Powershell 64bit
This topic applies to InstallAware Multi Platform as well.
You're using the wrong folder (that is the 32-bit folder).
Set 64 bit mode before calling Run Program, and invoke from the system32 folder (yes, crazy but that is the 64-bit folder).
If you don't set 64 bit mode before the call, the OS itself will automagically redirect your call to the 32 bit folder again (that you are actually presently referencing anyways).
You're using the wrong folder (that is the 32-bit folder).
Set 64 bit mode before calling Run Program, and invoke from the system32 folder (yes, crazy but that is the 64-bit folder).
If you don't set 64 bit mode before the call, the OS itself will automagically redirect your call to the 32 bit folder again (that you are actually presently referencing anyways).
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
-
- Posts: 2
- Joined: Wed Nov 13, 2024 10:12 am
Re: Running Powershell 64bit
Great advice, now working.
Thanks for your help.
Paul
Thanks for your help.
Paul
Who is online
Users browsing this forum: No registered users and 186 guests