I'm curious if there is a way to force 64-bit PowerShell to be used by PRTG?
Force 64-bit PowerShell?
Votes:
0
Best Answer
Votes:
3
Hello
After trying a lot in the syswow64 registry to work around this issue a colleague of mine told me about the sysnative folder. I don’t know what you are trying to do but for example I use the failoverclusters module this way.
Create a custom sensor that executes a .ps1 script that contains the following line:
c:\windows\<sysnative>\windowspowershell\v1.0\powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\yourpowershell64bitscript.ps1"
Please replace <sysnative> either with "System32" when you want to use the 64bit Powershell or with "SysWOW64" for the 32bit version.
Then create the yourpowershell64bitscript.ps1 powershell script with the 64bit module you want to load and output the values in here. Something like:
<# This is handy for reading the logfile of the sensor so you will see the modules available that are not in the the 32 bit version of powershell _#> Get-Module –ListAvailable Import-Module failoverclusters $csv = Get-Cluster -Name fqdn.clustername Write-Host $csv.id
When you execute the sensor you will see a powershell.exe *32 in your task manager. Because the sysnative folder is only available from a 32 bit powershell it executes the 64 bit powershell with the –file option. You will see a powershell.exe appear besides the powershell.exe *32.
Hope this gets you further.
PeterStamBam
Created on May 17, 2011 11:32:55 AM
Last change on Feb 9, 2012 3:07:51 PM by
Konstantin Wolff [Paessler Support]
4 Replies
Votes:
0
Hello,
I'm afraid that is not possible.
Best Regards.
Votes:
3
Hello
After trying a lot in the syswow64 registry to work around this issue a colleague of mine told me about the sysnative folder. I don’t know what you are trying to do but for example I use the failoverclusters module this way.
Create a custom sensor that executes a .ps1 script that contains the following line:
c:\windows\<sysnative>\windowspowershell\v1.0\powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\yourpowershell64bitscript.ps1"
Please replace <sysnative> either with "System32" when you want to use the 64bit Powershell or with "SysWOW64" for the 32bit version.
Then create the yourpowershell64bitscript.ps1 powershell script with the 64bit module you want to load and output the values in here. Something like:
<# This is handy for reading the logfile of the sensor so you will see the modules available that are not in the the 32 bit version of powershell _#> Get-Module –ListAvailable Import-Module failoverclusters $csv = Get-Cluster -Name fqdn.clustername Write-Host $csv.id
When you execute the sensor you will see a powershell.exe *32 in your task manager. Because the sysnative folder is only available from a 32 bit powershell it executes the 64 bit powershell with the –file option. You will see a powershell.exe appear besides the powershell.exe *32.
Hope this gets you further.
PeterStamBam
Created on May 17, 2011 11:32:55 AM
Last change on Feb 9, 2012 3:07:51 PM by
Konstantin Wolff [Paessler Support]
Votes:
0
Votes:
0
hello,
you should try this: https://stackoverflow.com/questions/19055924/how-to-launch-64-bit-powershell-from-32-bit-cmd-exe
rgds, Olivier
Add comment