Through PowerShell, I am attempting to create a new event log and write a test entry to it, but it is not showing up the Event Viewer. This is the command I'm using to create a new event log:
new-eventlog -logname TestLog -source TestLog
And to write a new event to it:
write-eventlog TestLog -source TestLog -eventid 12345 -message "Test message"
After running the first command, there is no "TestLog" log in the event viewer anywhere, and I would expect it to show up in the Applications and Services Logs section. After running the second command, same result. However, I am seeing a registry key for the log at HKLM\SYSTEM\services\eventlog\TestLog. Just not seeing anything in the event viewer.
So, 2 questions: When should I be seeing the event log? After it gets created or after I write the first event to it? And, more importantly, why am I not seeing it at all?
I'm using Windows Server 2008R2, and am logged in and running the PS as an administrator.