## send-eventmessage ## aaron bockelie # a wrapper for setting up an event. Simplifies creating events, since it creates the function Send-EventMessage {param( $eventMessage = 'This event was created with a null message', $eventType = 'Information', $eventID = 38000, $eventLogName = 'Application', [Parameter(Mandatory=$true)]$EventLogSource ) $sourceExists = $false #set for testing eventsource try { $sourceExists = [System.Diagnostics.EventLog]::SourceExists($EventLogSource) } catch {} #try getting eventlogsource if (!$sourceExists) { New-EventLog -logname $EventLogName -source $EventLogSource } #if an object was not returned, create an eventlog of eventlogsource type. Write-EventLog -logname $eventLogName -source $EventLogSource -eventid $eventID -message $eventMessage -entrytype $eventType }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8410 | Aaron Bockelie |
Root checkin, Perforce Powershell wrapper. Still lots of work to be done, namely documentation and deployment tools, for instance, get-help needs work on the majority of these tools. Additionally, the /lib structure needs a little bit of condensation, probably into major groups (depot, userspec, clientspec, group management, and so on) that way function family can exist under each resource. |