Skip to content

Instantly share code, notes, and snippets.

@mapledyne
Last active May 19, 2017 20:45
Show Gist options
  • Save mapledyne/9d2899397e3c1163ae59c1ebc5839ecf to your computer and use it in GitHub Desktop.
Save mapledyne/9d2899397e3c1163ae59c1ebc5839ecf to your computer and use it in GitHub Desktop.
Add new Windows event log source via Chef.
# Note: You may want to change 'Application' in here, or make it more general,
# if you're wanting your data sources to be put somewhere else.
powershell_script 'Custom Event Log' do
code "new-eventlog -logname Application -source '#{name}'"
guard_interpreter :powershell_script
not_if "[System.Diagnostics.EventLog]::SourceExists('#{name}')"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment