Clear Event Logs with PowerShell

Ever needed to clear all events from each of the 1100+ Event Viewer logs on a Windows workstation? From an elevated PowerShell console, run the following script to clear the event logs in Event Viewer… wevtutil el | Foreach-Object {wevtutil cl “$_”}   Good luck.

How to check what version of PowerShell is installed

The following two commands will provide information on what version of PowerShell is installed on your local Windows machines. Get-Host $PSVersionTable Get-Host will produce the following results when run on machines with PowerShell 2.0, 3.0, 4.0 and 5.x installed. NOTE: “InstanceID” varies per machine. Also, Get-Host will not produce the proper version if running via a remote…