Post from January, 2009

Write to EventLog using PowerShell

Thursday, 29. January 2009 15:43

I wanted to use a custom event log with a custom source. This can be done like this:

[system.diagnostics.Eventlog]::CreateEventSource(“MyOwnSource”, “MyEventLog”)
[system.diagnostics.eventlog]::WriteEntry(“MyOwnSource”,”Hello World”,[system.diagnostics.eventlogentrytype]::Error)

Category:EventLog, PowerShell | Comments (2) | Author: Dennis Damen

Download File using PowerShell

Friday, 16. January 2009 8:19

Just a quick one:

(new-object system.net.webclient).DownloadFile(“http://somesite.com/somefile.txt”,”c:\temp\somefile.txt”)

Category:Internet, PowerShell | Comment (0) | Author: Dennis Damen