Skip to content

New-PodeLogEventViewerMethod

SYNOPSIS

Create a new Event Viewer Log Method.

SYNTAX

New-PodeLogEventViewerMethod [[-Id] <String>] [[-EventLogName] <String>] [[-Source] <String>]
 [[-EventID] <Int32>] [[-BatchInfo] <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Creates a new Event Viewer Log Method for outputting log items to the Windows Event Viewer. Can be used with Enable-PodeLogRequestType, Enable-PodeLogErrorType, or Add-PodeLogType.

EXAMPLES

EXAMPLE 1

$methodId = New-PodeLogEventViewerMethod

EXAMPLE 2

$batchInfo = New-PodeLogBatchInfo -Size 10 -Timeout 10
$methodId = New-PodeLogEventViewerMethod -EventLogName 'MyLog' -Source 'MyApp' -EventID 1001 -BatchInfo $batchInfo

PARAMETERS

-BatchInfo

An optional hashtable containing batch configuration for writing log items in bulk. Should be created using New-PodeLogBatchInfo.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EventID

An Optional EventID for the Event Viewer (Default: 0)

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-EventLogName

An Optional Log Name for the Event Viewer (Default: Application)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Application
Accept pipeline input: False
Accept wildcard characters: False

-Id

An optional ID to assign to the Log Method. If not supplied, a random ID will be generated.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Source

An Optional Source for the Event Viewer (Default: Pode)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: Pode
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES