Skip to content

PoShLog/PoShLog.Sinks.EventLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PoShLog.Sinks.EventLog

psgallery PowerShell Gallery psgallery Discord Build Status

PoShLog.Sinks.EventLog is extension module for PoShLog logging module. Contains sink that publishes log messages to Windows Event Log.

Getting started

If you are familiar with PowerShell, skip to Installation section. For more detailed installation instructions check out Getting started wiki.

Installation

To install PoShLog.Sinks.EventLog, run following snippet from powershell:

Install-Module PoShLog.Sinks.EventLog

Usage

Note that before first use you should run following as administrator to register your -Source(Sample Script). Notice the -ManageEventSource parameter.

Import-Module PoShLog
Import-Module PoShLog.Sinks.EventLog

New-Logger |
    Add-SinkEventLog -Source 'Sample Script' -ManageEventSource $true |
    Start-Logger

Close-Logger

After that you can run your scripts under default privileges and you can ommit -ManageEventSource parameter, as long as you don't change -Source parameter.

Import-Module PoShLog
Import-Module PoShLog.Sinks.EventLog

New-Logger |
    Add-SinkEventLog -Source 'Sample Script' |
    Start-Logger

Write-InformationLog 'My message in windows event log'

Close-Logger

image

Documentation

These examples are just to get you started fast. For more detailed documentation please check wiki.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

About

PoShLog sink that writes events to Windows Event Log

Resources

License

Stars

Watchers

Forks

Packages

No packages published