< Back
Exit-Event
Post
NAME Exit-Event
SYNOPSIS
Logs various information about the script before leaving with return code to which 1000 has been added (for
compatibility with SolarWinds checks)
If a temporary admin user was created then delete it
Adds to $global:debug, 'runtime' & ErrorCount & $ExitCode
If $global:debug is set then write $global:Output to console
Writes an EventID $ReturnCode with text $global:Output into the log defined in $global:EventLog with event source
set as defined in $global:EventSource and EntryType as INFORMATION
SYNTAX
Exit-Event [-ReturnCode] <Int32> [<CommonParameters>]
DESCRIPTION
PARAMETERS
-ReturnCode <Int32>
Required? true
Position? 1
Default value 0
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:\\>Exit-Event 1
RELATED LINKS
SYNOPSIS
Logs various information about the script before leaving with return code to which 1000 has been added (for
compatibility with SolarWinds checks)
If a temporary admin user was created then delete it
Adds to $global:debug, 'runtime' & ErrorCount & $ExitCode
If $global:debug is set then write $global:Output to console
Writes an EventID $ReturnCode with text $global:Output into the log defined in $global:EventLog with event source
set as defined in $global:EventSource and EntryType as INFORMATION
SYNTAX
Exit-Event [-ReturnCode] <Int32> [<CommonParameters>]
DESCRIPTION
PARAMETERS
-ReturnCode <Int32>
Required? true
Position? 1
Default value 0
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:\\>Exit-Event 1
RELATED LINKS