Sends an event (often an error) from a script to a Seq server, including script info.
Send-SeqScriptEvent.ps1 [-Action] <String> [[-ErrorRecord] <ErrorRecord>] [[-Level] <String>]
[-InvocationScope <String>] [-Server <Uri>] [-ApiKey <String>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
try { Connect-Thing } catch { Send-SeqScriptEvent.ps1 'Trying to connect' $_ -Level Error -Server http://my-seq }
A description of what was being attempted.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An optional PowerShell ErrorRecord object to record. Will try to automatically find $_ in a calling “catch{}”” block.
Type: ErrorRecord
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: ((Get-Variable _ -Scope 1 -ValueOnly -EA SilentlyContinue) -as [Management.Automation.ErrorRecord])
Accept pipeline input: False
Accept wildcard characters: False
The type of event to record. Defaults to Error if an ErrorRecord is found, Information otherwise.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Error
Accept pipeline input: False
Accept wildcard characters: False
The scope of the script InvocationInfo to use. Defaults to 1 (the script calling Send-SeqScriptEvent.ps1). Sending a 2 will try to use the script calling the script calling this one.
Type: String
Parameter Sets: (All)
Aliases: Scope
Required: False
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
The URL of the Seq server.
Type: Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The Seq API key to use.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.