< Back

Add-EventLogChannel

Tue Jan 14, 2020 3:24 am

NAME Add-EventLogChannel



SYNOPSIS

Adds an EventLog Channel to the LoggingChannelList list





SYNTAX

Add-EventLogChannel [-EventLogName] <String> [-EventLogSourceName] <String> [<CommonParameters>]





DESCRIPTION

The Add-EventLogChannel cmdlet adds a Channel to the LoggingChannelList list that is capable of logging to the

EventLog.



To write an event to an event log, the event log must exist on the computer and the source must be registered for

the event log.

If either the EventLog or the Source don't exist on the computer when this cmdlet is called they will be created.



Note: Creating an EventLog and/or Source requires administrator privileges





PARAMETERS

-EventLogName <String>

Specifies the event identifier. This parameter is required. The maximum allowed value for the EventId

parameter is 65535.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EventLogSourceName <String>



Required? true

Position? 3

Default value

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-LogError 1 "Some Error you want to log"















RELATED LINKS