Skip to content

Instantly share code, notes, and snippets.

@dougm
Created March 9, 2011 02:44
Show Gist options
  • Save dougm/861593 to your computer and use it in GitHub Desktop.
Save dougm/861593 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'win32ole'
require 'nokogiri'
wsman = WIN32OLE.new("WSMAN.Automation")
session = wsman.CreateSession
locator = wsman.CreateResourceLocator("winrm/config")
response = session.Get(locator)
xml = Nokogiri::XML.parse(response).remove_namespaces!
puts xml #to hash??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment