Sha256: 19e026ff389813277d7bc8799288839a62cec53da07b8e064170b268219157a9
Contents?: true
Size: 431 Bytes
Versions: 6
Compression:
Stored size: 431 Bytes
Contents
require 'win32ole' VALUES = ['CategoryString', 'Message', 'TimeGenerated', 'User', 'Type'] query = "select #{VALUES.join(',')} from Win32_NtLogEvent where Logfile = 'Application' and TimeGenerated > '20100713000000.000000-***'" wmi = WIN32OLE.new "WbemScripting.SWbemLocator" connection = wmi.connectserver connection.ExecQuery(query).each do |result| puts VALUES.map { |v| "#{v}: #{result.__send__(v).to_s}" }.join(", ") end
Version data entries
6 entries across 6 versions & 1 rubygems