Yesterday my good friend Marcos Freccia (blog | twitter) asked me a simple and fast way to save the output of get-eventlog on a SQL Server table. Well the easiest and fastest way that I know is using the functions of the Chad Miller (Out-DataTable and Write-DataTable), because the write-datatable using bulk insert. I took the liberty to change the write-datatable to get the object by Pipeline, and you can download below.
But the solution is :
Firts Create the table :
then the Posh script :
Simple, Fast and Clean. As always when we are using PowerShell.