I would like to get information about the Powershell Version which runs my custom Powershell Sensor.
Article Comments
Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.
You can use two very short scripts to gather information on the Powershell Sessions which execute your custom scripts on your computer.
Create a 'ps1' file in your Custom Sensors Folder of PRTG and enter this line:
write-host $Host.Version.Major,":OK ",$Host.Version.Major,".",$Host.Version.Minor
Create a Custom Sensor using the scriptfile you have just created. The script will return the version number of Powershell when executed.
To determine if the Powershell Session runs in a 32bit or 64bit environment create a script containing the following lines:
if ([System.IntPtr]::Size -eq 8)
{
write-host 64,":64bit Session"
}
else
{
write-host 32,":32bit Session"
}
Create an EXE/Script sensor for the script you just created, and it will return the environment of the Powershell Session.
May, 2011 - Permalink
You can use two very short scripts to gather information on the Powershell Sessions which execute your custom scripts on your computer.
Create a 'ps1' file in your Custom Sensors Folder of PRTG and enter this line:
write-host $Host.Version.Major,":OK ",$Host.Version.Major,".",$Host.Version.MinorCreate a Custom Sensor using the scriptfile you have just created. The script will return the version number of Powershell when executed.
To determine if the Powershell Session runs in a 32bit or 64bit environment create a script containing the following lines:
if ([System.IntPtr]::Size -eq 8) { write-host 64,":64bit Session" } else { write-host 32,":32bit Session" }Create an EXE/Script sensor for the script you just created, and it will return the environment of the Powershell Session.
May, 2011 - Permalink