New-PSUSystemEvent
cmdlet within the systemEvents.ps1
file. The following example triggers the systemEvent.ps1
script when a pwsh.exe
process is started.$TargetInstance
parameter. This contains the WMI object that caused the event to trigger.