JulianMcConnell.com

PSWinEventLogTool Experimental Automation Support

PowerShell PSWinEventLogTool parameters automation scripting wevtutil Event Viewer Windows Logs

By request, I have updated PSWinEventLogTool to incorporate some basic input parameters for making it compatible with scripting and automation.

Support is experimental and here is how it works...

Example Usage:

.\PSWinEventLogTool.ps1 -param_evt_log 1 -param_time_unit 1 -param_time_how_much 15

The example above should bypass the menus and return a zip containing the Application Log exported for the last 15 minutes previous to the execution time.

Parameters:

param_evt_log - Selects which event log, from the available options:

  1. Application Log
  2. System Log
  3. Security Log
  4. All Logs

param_time_unit - Selects the unit of time we are exporting in, from the available options:

  1. Minutes
  2. Hours
  3. Days
  4. Weeks
  5. All Time

param_time_how_much - How much of the selected time unit are we exporting (if applicable - not required if param_time_unit is set to 5):

Check the GitHub repo to test it out.