Git Product home page Git Product logo

node-wmi's Introduction

JP Grusling

LinkedIn email


Hey There! 👋

Hi, I'm JP. I am an experienced software developer and devops practitioner. Currently involved in web technologies but with a history in native development. I am passionate about being involved in all stages of the development lifecycle from conception to setup to implementation to launch and maintenance. I also love using my devops mindset to streamline developer experience and make team more productive.

Tech, Tools & Skills

Dev

languages: C# TypeScript JavaScript

frameworks: .NET NodeJS React NextJS Payload CMS

databases: MySQL MongoDB SQLite

tools: VS Code Visual Studio git Github GitLab

DevOps

platforms: AWS DigitalOcean Rancher

CI: Github Actions GitLab CI

IaC: Terraform

other: Ubuntu Docker

node-wmi's People

Contributors

jgrusling avatar jpgrusling avatar vertigoray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-wmi's Issues

Add Support for Call

Since you're just calling wmic.exe as a child process, it should be easy enough to inject CALL after WHERE.

https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx

CALL

Executes a method.

Example: SERVICE WHERE CAPTION='TELNET' CALL STARTSERVICE

Note To determine the methods available for a given class, use /?. For example, SERVICE WHERE CAPTION='TELNET' CALL /? lists the available functions for the service class.

Question: Set Encoding

Hi, how i can set enconding in results?
i try cp.stdout.setEncoding('utf8') but no result.

Example:
Caption: "Procesador de datos num�ricos"

..where � is an é

Thank you!!

WMI Dates show `Invalid Date`.

> wmi.Query().class('Win32_OperatingSystem').exec(function(err, operatingsystem) {
...    console.log(operatingsystem[0].InstallDate);
... });
undefined
> Invalid Date

If I pull it via PowerShell:

PS C:\> Get-WmiObject Win32_OperatingSystem | select InstallDate

InstallDate
-----------
20170414095919.000000-300

That's definitely an ugly date, but still very parse-able. Regardless, if you can't parse a date, you should return the original value, not revert to undefined. Let the user worry about parsing it. At this point, I either have to fix your module, find one that already works, or write my own.

Deprecation warning by moment.js

Deprecation warning: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 20150304000000.000000+000, _f: undefined, _strict: undefined, _locale: [object Object]

Depending on package.json for initializing `debug` instances breaks production bundles

In Query.js, this package relies on package.json to exist in order to name the debug instances. This is silly, and breaks when the package is bundled into a production application, resulting in the entire node-wmi package (and all of it's dependencies) to be excluded from the bundling process.

Simply hardcoding these as node-wmi:Query resolves it. PR for fix found here: #16

MSAcpi_ThermalZoneTemperature undefined

it returns undefined any idea y ?

wmi.Query({
class: 'MSAcpi_ThermalZoneTemperature',
namespace : 'root/wmi'
}, function(err, data) {
console.log(data);
});

charset problem

I use this module in the virtual machine to get garbled operating system information, but it is normal to use native wmi statements.

28bd62ec-8221-4831-b2d4-9ef5722d5d39
qq20180522-110140 2x

Example doesnt work

Hi

I get this error when trying the first example

TypeError: this.exec is not a function
at new Query (C:\GIT\ect-client\node_modules\node-wmi\lib\Query.js:369:10)
at Object.Query (C:\GIT\ect-client\node_modules\node-wmi\lib\Query.js:343:12)
at Object. (C:\GIT\ect-client\test.js:3:5)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)

Code is this

var wmi = require('node-wmi');

wmi.Query({
  class: 'Win32_BIOS'
}, function(err, bios) {
  console.log(bios);
});

unit test fails

if (!this._params.class) {
^

TypeError: Cannot read property 'class' of undefined
at Array.exec (c:\git\node-wmi\lib\Query.js:254:20)
at c:\git\node-wmi\node_modules\async\lib\async.js:596:38
at _arrayEach (c:\git\node-wmi\node_modules\async\lib\async.js:85:13)
at Object.async.auto (c:\git\node-wmi\node_modules\async\lib\async.js:554:9)
at Object. (c:\git\node-wmi\test\index.js:6:7)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

Querying Win32_PNPAllocatedResource returns empty objects

Hello, I try to query Win32_PNPAllocatedResource like this:

wmi.Query({
    class: 'Win32_PNPAllocatedResource',
    //where: "Dependent LIKE '%'"
}, function(err, resource) {
    console.log(resource);
});

It just returns an array of empty objects.
I'm on local-host, node 10.1.1 LTS , WIndows 10 October Update

querying for multiple properties

I have not found a way to collect more than one property other than to collect all/any by not providing the criteria. I this possible?
Example I am trying to query class: 'Win32_BIOS'
and return Properties: 'SMBIOSBIOSVersion', 'SerialNumber'

Issue with PartCompenent type resposnses

Running Win32_GroupUser via normal WMI I get this resposne:


Win32_GroupUser instance

GroupComponent: \COMPUTERNAME\root\cimv2:Win32_Group.Domain="COMPUTERNAME",Name="Guests"
PartComponent: \COMPUTERNAME\root\cimv2:Win32_UserAccount.Domain="COMPUTERNAME",Name="Guest"

However empty array is returned. It looks like the , is breaking the return.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.