< Back

Write-Event

Fri Jan 10, 2020 7:53 pm

NAME Write-Event



SYNOPSIS

Add the text passed as a parameter into the $global:Output variable

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 INFORMATION and EventID 666

Get-StackIndent function is called to add some leading information about the script





SYNTAX

Write-Event [-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-Event "Some text"















RELATED LINKS