What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

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

How to avoid line breaks for Powershell custom scripts used with an EXE/Script sensor?

Votes:

0

Your Vote:

Up

Down

The values given back by custom EXE/Script sensors may not contain any line breaks, otherwise the sensor will not be able to process them correctly.

How do I avoid line breaks when using a Powershell script with PRTG?

custom-sensor powershell prtg

Created on Nov 3, 2010 2:48:30 PM by  Daniel Zobel [Product Manager]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Powershell seems to perform automatic word wrapping when executed on the command line like

Powershell -file script.ps1 > output.txt

In order to avoid automatic line breaks, please start your Powershell scripts with the following line:

$host.UI.RawUI.BufferSize = new-object System.Management.Automation.Host.Size(512,50)

Created on Nov 3, 2010 2:51:20 PM by  Daniel Zobel [Product Manager]



Please log in or register to enter your reply.


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.