I'm getting the following error on a custom sensor: Response not well-formed: "(A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows. )" (code: PE132) This is the script I'm running:

#gets the file and its last line
$and = (Get-Content \\computername\c$\folder\DB\license.lic)[-1]

#separates each value by finding every space
$separator = " "

#removes repeating separators since there are multiple spaces
$opt = [System.StringSplitOptions]::RemoveEmptyEntries

#sets the split as a value
$drew = $and.Split($separator,$opt)

#runs the command and, counting left, writes the sixth position from the far right to a variable for collection, tags it with an identifier for PRTG
write-host $drew[6] ":Current Users"

#write status of normal to PRTG
exit 0

If I add the following to my script, the sensor changes from "Down" to "Up", but it does not return the count I'm looking for: value:ok Can anyone offer any suggestions?


Article Comments

Hi there,

Please try to use write-output instead of write-host Please check if the issue occurs again afterwards.


Kind regards

Felix Wiesneth - Team Tech Support


Aug, 2021 - Permalink

The sensor is now up with no errors after changing it to write-output However, the result is returning Value 0. When I run the script manually, the expected result is returned appropriately.


Aug, 2021 - Permalink

Hi there,

Good to hear that the sensor is up and running. Since it seems from first look good, I would recommend to check our guide for PowerShell based sensors.


Kind regards

Felix Wiesneth - Team Tech Support


Aug, 2021 - Permalink