MSAdministrator / PSLogging

A PowerShell Logging Module that uses Classes to log to the console, log file, or the event viewer
MIT License
13 stars 3 forks source link

PSLogging

A PowerShell V5 class that can log to:

Synopsis

Used to create and output information from functions to a specific (or all three) log types

Description

This function will write to a all or one log type. Each log type can have a specified log type of:

Informational (Info)
Success (Success)
Warning (Warning)
Debugging (Debug)
Error (Error)
Error (Error & ErrorRecord)

This Class can be used directly by loading the 'PSLogging.ps1' file in the 'Class' folder or by using one of the functions contained in the 'Public' folder.

Using PSLogging Class's directly

As mentioned previously, there are multiple classes contained within the PSLogging.ps1 file. These are listed below, as well as their individual documentation pages:

Notes

   Name: Write-LogEntry
   Created by: Josh Rickard
   Created Date: 04/01/2017

Functionality

Write-LogEntry is a PowerShell helper function that will accept or create a log file and add strings based on severity, as well as parse $error[0] records for easy interpretation and readability.