Adding and editing a PowerShell action

Windows PowerShell is a scripting language and command-line shell that system administrators can use to manage Windows operating systems. For more information on PowerShell, please visit the Microsoft web site.

The PowerShell action delivers a robust and flexible environment to the experienced user for developing custom actions through direct access to script component libraries, including the .NET Framework. For more information, see PowerShell action script examples.

To add a new PowerShell action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library appears.
  2. Click New. The Select Action Type dialog appears.
  3. Select PowerShell, then click OK. The New PowerShell Script Action dialog appears.
  4. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Timeout (seconds). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the device. This is considered a failed connection.

    Note: You are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    • Script Text. Enter your action code.

      Important: When using percent variables as part of string literals in your PowerShell scripts, please use double quotation marks (" ") instead of single quotation marks (' ') to enclose the string literal. For example: $Message = "%Device.DisplayName changed state".

  5. Click OK to save changes.
  6. Click OK to exit the Action Library.

To edit an existing PowerShell action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library dialog appears.
  2. Select the action you would like to edit, then click Edit. The Edit PowerShell Script Action dialog appears.
  3. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the device. This is considered a failed connection.

    Note: You are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    • Script Text. Enter your action code.
  4. Click OK to save changes.
  5. Click OK to exit the Action Library.

See Also

Configuring an action

Adding and editing an Active Script Action

Adding and editing a Beeper Action

Adding and editing an Email Action

Adding and editing a Log to Text File Action

Adding and editing a Pager Action

Example - PowerShell action scripts

Adding and editing a Program Action

Adding and editing a Service Restart Action

Adding and editing a SMS Action

Adding and editing a SMS Direct Action

Adding and editing a SNMP Set Action

Adding and editing a Sound Action

Adding and editing a SSH Action

Adding and editing a Syslog Action

Adding and editing a Text-To-Speech Action

Adding and Editing a VMware Action

Adding and Editing a Web Alarm Action

Adding and Editing a Windows Event Log Action

Using the WinPopup Action