PowerShell: Check if Event Log Source exists
[System.Diagnostics.EventLog]::SourceExists("MyScript")
[System.Diagnostics.EventLog]::LogNameFromSourceName("Source","MachineName")
[System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.GetLogNames() -contains 'Microsoft-Windows-Sysmon/Operational'