What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

Retrieving File Version Number? (Powershell)



I have made a custom sensor that uses a Powershell script to show the file version of an executable, the script is below:

(Get-Command "C:\XXX\XXX\XXX\XXX.exe").FileVersionInfo.Fileversion

Using this, the version does display correctly in the monitor. However, it displays in an error state. How do I make it so that it no longer is an error, but still displays the file version of an executable?

Much appreciated in advanced.

exe-script powershell prtg

Created on Feb 29, 2012 5:47:15 AM

1 Reply



please note that PRTG expects a specific format for return values:


In your case the script has to look something like this:

@echo off

$return_fileversion = (Get-Command "C:\XXX\XXX\XXX\XXX.exe").FileVersionInfo.Fileversion
echo $return_fileversion + ":OK"

For further documentation please go, in your PRTG installation, "Setup" -> "PRTG API". Best Regards

Created on Feb 29, 2012 10:13:31 AM by  Konstantin Wolff [Paessler Support]

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.