https://github.com/chef/wmi-lite
Lightweight, low-dependency wrapper for basic WMI functionality on Windows.
https://github.com/chef/wmi-lite
Keywords from Contributors
chef cfgmgt deployment configuration-management discovery ohai
Last synced: about 13 hours ago
JSON representation
Repository metadata
Lightweight, low-dependency wrapper for basic WMI functionality on Windows.
- Host: GitHub
- URL: https://github.com/chef/wmi-lite
- Owner: chef
- License: apache-2.0
- Created: 2014-05-13T00:26:54.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2025-12-02T04:08:19.000Z (10 days ago)
- Last Synced: 2025-12-09T01:29:34.409Z (3 days ago)
- Language: Ruby
- Size: 115 KB
- Stars: 14
- Watchers: 13
- Forks: 7
- Open Issues: 7
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
README.md
Wmi-Lite
wmi-lite is a lightweight Ruby gem utility library for accessing basic
Windows Management Instrumentation (WMI)
functionality on Windows. It has no dependencies outside of the Ruby interpreter
and libraries and of course the Windows operating system.
Installation
To install it, run:
gem install wmi-lite
Usage
To use wmi-lite in your Ruby source code, just require it:
require 'wmi-lite'
You can then instantiate an object through WmiLite::Wmi.new that will allow you to query a WMI namespace by calling methods on
that object.
- The default namespace if no argument is specified to
newisroot\cimv2. To override, pass the desired WMI
namespace string as an argument to the constructor. - To execute queries against the object's namespace, use the
instances_of,first_of, andquerymethods. - The
instances_ofmethod will return all instances of a given class in the namespace as an array of instances. - The
querymethod returns the results of an arbitrary WMI Query Language (WQL) query as an array of instances. - The
first_ofmethod will return the first of all instances of a given class in the namespace. - Each instance is represented by a Ruby
Hashfor which each property value of the instance is indexed by
the string name of the property as documented in the WMI Schema or
as registered in the local system's WMI repository. - The string name specified to the aforementioned
Hashis case insensitive.
Examples
Use of the instances_of, query, and first_of methods of the WmiLite::Wmi object is demonstrated below.
Count cores in the system
cores = 0
wmi = WmiLite::Wmi.new
processors = wmi.instances_of('Win32_Processor')
processors.each do | processor |
cores += processor['numberofcores']
end
puts "\nThis system has #{cores} core(s).\n"
Determine if the system is domain-joined
wmi = WmiLite::Wmi.new
computer_system = wmi.first_of('Win32_ComputerSystem')
is_in_domain = computer_system['partofdomain']
puts "\nThis system is #{is_in_domain ? '' : 'not '}domain joined.\n"
List Group Policy Objects (GPOs) applied to the system
wmi = WmiLite::Wmi.new('root\rsop\computer')
gpos = wmi.instances_of('RSOP_GPO')
puts "\n#{'GPO Id'.ljust(40)}\tName"
puts "#{'------'.ljust(40)}\t----\n"
gpos.each do | gpo |
gpo_id = gpo['guidname']
gpo_display_name = gpo['name']
puts "#{gpo_id.ljust(40)}\t#{gpo_display_name}"
end
puts 'No GPOs' if gpos.count == 0
puts
List ruby-related processes
puts "Ruby processes:\n"
wmi = WmiLite::Wmi.new
processes = wmi.query('select * from Win32_Process where Name LIKE \'%ruby%\'')
puts "\n#{'Process Id'.ljust(10)} Name"
puts "#{'----------'.ljust(10)} ----\n"
processes.each do | process |
pid = process['processid']
name = process['name']
puts "#{pid.to_s.ljust(10)} #{name}"
end
puts
Development Documentation
All documentation is written using YARD. You can generate a by running:
rake docs
Contributing
For information on contributing to this project please see our Contributing Documentation
License & Copyright
- Copyright:: Copyright (c) 2014-2018 Chef Software, Inc.
- License:: Apache License, Version 2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Owner metadata
- Name: Progress Chef
- Login: chef
- Email: ops@chef.io
- Kind: organization
- Description:
- Website: https://www.chef.io/
- Location: United States of America
- Twitter: chef
- Company:
- Icon url: https://avatars.githubusercontent.com/u/29740?v=4
- Repositories: 245
- Last ynced at: 2023-04-10T00:51:04.360Z
- Profile URL: https://github.com/chef
GitHub Events
Total
- Issues event: 1
- Watch event: 1
- Issue comment event: 1
- Member event: 1
- Push event: 9
- Pull request review comment event: 1
- Pull request review event: 5
- Pull request event: 12
- Fork event: 1
- Create event: 5
Last Year
- Issues event: 1
- Watch event: 1
- Issue comment event: 1
- Member event: 1
- Push event: 9
- Pull request review comment event: 1
- Pull request review event: 5
- Pull request event: 12
- Fork event: 1
- Create event: 5
Committers metadata
Last synced: 8 days ago
Total Commits: 88
Total Committers: 10
Avg Commits per committer: 8.8
Development Distribution Score (DDS): 0.67
Commits in past year: 11
Committers in past year: 4
Avg Commits per committer in past year: 2.75
Development Distribution Score (DDS) in past year: 0.727
| Name | Commits | |
|---|---|---|
| Tim Smith | t****4@g****m | 29 |
| Adam Edwards | a****d@o****m | 23 |
| Chef Expeditor | c****i@c****o | 11 |
| John McCrae | j****e@p****m | 7 |
| jayashri garud | j****d@m****m | 5 |
| Chef Expeditor | e****r@c****o | 4 |
| Rishi Kumar Chawda | r****a | 3 |
| John McCrae | m****e@p****m | 3 |
| poornima | p****m@p****m | 2 |
| chef-expeditor[bot] | 4****] | 1 |
Committer domains:
- progress.com: 3
- chef.io: 2
- msystechnologies.com: 1
- opscode.com: 1
Issue and Pull Request metadata
Last synced: 10 days ago
Total issues: 3
Total pull requests: 34
Average time to close issues: N/A
Average time to close pull requests: over 1 year
Total issue authors: 3
Total pull request authors: 11
Average comments per issue: 0.33
Average comments per pull request: 0.26
Merged pull request: 19
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 15
Past year average time to close issues: N/A
Past year average time to close pull requests: about 1 month
Past year issue authors: 1
Past year pull request authors: 5
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.07
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- Sarkie (1)
- nathan-nhm (1)
- TeroPihlaja (1)
Top Pull Request Authors
- tas50 (9)
- johnmccrae (6)
- sean-sype-simmons (4)
- Saburesh07 (4)
- mwrock (2)
- srust (2)
- dafyddcrosby (2)
- jayashrig158 (2)
- adamedx (1)
- poorndm (1)
- rishichawda (1)
Top Issue Labels
- Status: Untriaged (2)
- Type: Bug (1)
Top Pull Request Labels
- Expeditor: Skip All (5)
- oss-standards (4)
- Expeditor: Bump Version Major (2)
- ai-assisted (1)
Package metadata
- Total packages: 2
-
Total downloads:
- rubygems: 103,117,222 total
- Total docker downloads: 873,682,292
- Total dependent packages: 4 (may contain duplicates)
- Total dependent repositories: 2,094 (may contain duplicates)
- Total versions: 14
- Total maintainers: 4
gem.coop: wmi-lite
A lightweight utility over win32ole for accessing basic WMI (Windows Management Instrumentation) functionality in the Microsoft Windows operating system. It has no runtime dependencies other than Ruby, so it can be used without concerns around dependency issues.
- Homepage: https://github.com/chef/wmi-lite
- Documentation: http://www.rubydoc.info/gems/wmi-lite/
- Licenses: Apache-2.0
- Latest release: 1.0.7 (published over 3 years ago)
- Last Synced: 2025-12-07T18:02:10.113Z (5 days ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 51,558,611 Total
- Docker Downloads: 436,841,146
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Downloads: 0.489%
- Average: 4.662%
- Forks count: 9.388%
- Stargazers count: 13.431%
- Maintainers (4)
rubygems.org: wmi-lite
A lightweight utility over win32ole for accessing basic WMI (Windows Management Instrumentation) functionality in the Microsoft Windows operating system. It has no runtime dependencies other than Ruby, so it can be used without concerns around dependency issues.
- Homepage: https://github.com/chef/wmi-lite
- Documentation: http://www.rubydoc.info/gems/wmi-lite/
- Licenses: Apache-2.0
- Latest release: 1.0.7 (published over 3 years ago)
- Last Synced: 2025-12-07T18:02:11.138Z (5 days ago)
- Versions: 7
- Dependent Packages: 4
- Dependent Repositories: 2,094
- Downloads: 51,558,611 Total
- Docker Downloads: 436,841,146
-
Rankings:
- Docker downloads count: 0.333%
- Downloads: 0.521%
- Dependent repos count: 0.68%
- Dependent packages count: 3.283%
- Average: 4.759%
- Forks count: 9.679%
- Stargazers count: 14.058%
- Maintainers (4)
Dependencies
- chefstyle = 1.2.0 development
- docile ~> 1.3.5 development
- github-markup >= 0 development
- pry >= 0 development
- pry-byebug >= 0 development
- rake >= 0 development
- rb-readline >= 0 development
- redcarpet >= 0 development
- rspec ~> 3.1 development
- simplecov ~> 0.18.5 development
- yard >= 0 development
Score: 26.046902169543067