Back to Geneos FAQ

How to set up the Toolkit plug-in to display PowerShell script output

On Windows, there is usually tighter control of PowerShell scripts (.ps1) than batch files or executables. For example, the default behavior of double-clicking a batch file (.bat) will execute the script, but double-clicking PowerShell files (.ps1) will open Notepad for editing. In order to use PowerShell commands or scripts, the powershell.exe executable should be explicitly called. There are also command parameters like execution policy that may need to be specified.

To help users get started, we have created an one line example below which displays the current system time.

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -Sta 'row,value'; $now=Get-Date; 'time,'+ $now.ToShortTimeString();

The command returns the system time together with the necessary headers in a CSV based format. This is required for parsing by the Toolkit plug-in.

Geneos - how to set up the Toolkit plug-in to display PowerShell script output

The PowerShell command is defined in the Toolkit sampler’s “Sampler script” field as seen below:

7232116442141 mceclip0

The command output will be displayed in the form of a dataview in the Active Console like this.

Screenshot

Further Reading

Geneos users can refer to the Toolkit Plug-In User Guide

["Geneos"] ["Geneos > Netprobe"] ["FAQ"]

Was this topic helpful?