< Back
Write-EventError
Post
NAME Write-EventError
SYNOPSIS
Add the text passed as a parameter into the $global:Output variable. Text added to has $global:Output a leading
"!" to indicate that it is an error message
If $globel:Debug is defined also writes the text into an event into the log defined in $global:EventLog with event
source set as defined in $global:EventSource and EntryType as ERROR and EventID 666
Get-StackIndent function is called to add some leading information about the script
SYNTAX
Write-EventError [-Message] <String> [<CommonParameters>]
DESCRIPTION
PARAMETERS
-Message <String>
Required? true
Position? 1
Default value $Global:nl
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Write-EventError "Some text"
RELATED LINKS
SYNOPSIS
Add the text passed as a parameter into the $global:Output variable. Text added to has $global:Output a leading
"!" to indicate that it is an error message
If $globel:Debug is defined also writes the text into an event into the log defined in $global:EventLog with event
source set as defined in $global:EventSource and EntryType as ERROR and EventID 666
Get-StackIndent function is called to add some leading information about the script
SYNTAX
Write-EventError [-Message] <String> [<CommonParameters>]
DESCRIPTION
PARAMETERS
-Message <String>
Required? true
Position? 1
Default value $Global:nl
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Write-EventError "Some text"
RELATED LINKS