For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set-PSUTrigger

SYNOPSIS

Updates an existing automation trigger.

SYNTAX

Set-PSUTrigger -Id <Int64> [-Name <String>] [-EventType <EventType>] [-Script <String>] [-Scripts <String[]>] [-TriggerScript <String>] [-Environment <String>] [-Dashboard <String>] [-Parameters <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]
Set-PSUTrigger -Trigger <Trigger> [-Name <String>] [-EventType <EventType>] [-Script <String>] [-Scripts <String[]>] [-TriggerScript <String>] [-Environment <String>] [-Dashboard <String>] [-Parameters <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]

<ConnectionOptions>: [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies].

DESCRIPTION

Updates a trigger by ID or pipeline object. Only supplied fields change. -Scripts replaces its script selection and supports multiple scripts; -Script selects a single script instead. -Parameters passes a hashtable to the trigger script when it fires and resolves that script's declared parameters. A blank -Name is rejected.

EXAMPLES

Set-PSUTrigger -Id 4 -Name 'Server Startup' -EventType ServerStarted
Set-PSUTrigger -Id 4 -Scripts 'Build.ps1','Deploy.ps1' -Parameters @{ Channel = 'ops' }

PARAMETERS

Parameter
Description

-Id

Numeric trigger ID.

-Trigger

Trigger object; accepts pipeline input.

-Name

New nonempty trigger name.

-EventType

Event type activating the trigger.

-Script

Selects one associated script and clears the multi-script selection.

-Scripts

Selects multiple associated scripts and clears the single-script selection.

-TriggerScript

Path of the script executed when the event fires.

-Environment

Execution environment.

-Dashboard

Associated app name.

-Parameters

Hashtable of parameters for the trigger script.

-ComputerName

Target PSU server URL or host name (alias -Uri).

-AppToken

Management API app token.

-Credential

Management API credentials.

-UseDefaultCredentials

Uses current Windows credentials.

-Integrated

Uses the in-process management client.

-TrustCertificate

Ignores certificate validation errors.

-Cookies

Reuses session authentication cookies.

INPUTS

UniversalAutomation.Trigger.

PERMISSIONS

The access token requires automation.triggers/update to run this cmdlet remotely.

Last updated

Was this helpful?