Skip to content

powerShellStart that return Promise #911

@xoxloviwan

Description

@xoxloviwan

Is your feature request related to a problem? Please describe.
powerShellStart() and powerShellRelease() functions start and close a PowerShell process that may be running after some time (especialy on weak PC). Now in promise chain I can't get any status of running; and I can't know when PowerShell process was ready to work.

Describe the solution you'd like
remake current functions or add new Promise-based variant of reailzation powerShellStart() that allow run this way:

     let specs = [ 'system', 'diskLayout', 'graphics' ];
     si.powerShellStartPromisify()
       .then(() => Promise.all(specs.map(async (item) => (info[item] = await si[item]())));

Describe alternatives you've considered
Now I have to write something like this:

     let specs = [ 'system', 'diskLayout', 'graphics' ];
     new Promise((resolve) => {
            si.powerShellStart();
            setTimeout(() => resolve(), 1000);
     })
    .then(() => Promise.all(specs.map(async (item) => (info[item] = await si[item]())));

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions