-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows, international character sets, powerShell, wmic #616
Comments
@sebhildebrandt have you tried calling exec with powershell set as the shell? |
@si458 Thank you, currently making several tests to that. There are some possibilities that I am thinking of. Now testing which ones are faster ... |
I made detailed research and it turns out that spinning up PowerShell Process is responsible for consuming a lot of resources and time. I now created a possibility to create a persistent PowerShell which then should reduce resources by 90% ... It would be great if you can test the latest code here on GitHub: What you have to do to enable the persistent power shell:
All commands In between will then use this already pinned up powerShell. The implementation ist still a little hacky ... but if your results are fine and this is what you would like to use, I will make a clean up! Any comments are welcome! |
Hi @sebhildebrandt the is no documentation about if i use the Ive managed to narrow down the if i replace the but whats even weirder, any help would be amazing!? SAMPLE CODE BELOW:
|
@si458 as I am still try to improve the situation, I did not made any official documentation about Concerning your findings with |
@sebhildebrandt glad i could help, any testing let me know 👍 |
@sebhildebrandt narrowed the issue abit for you, systeminformation/lib/osinfo.js Lines 1138 to 1146 in acf1a89
the resolve isnt being returned from inside this function (or rather it is but the powershell is stopping it for some reason?) if you comment out L1138-L1146 (LEAVE resolve(result); L1145 uncommented) it returns no problems
EDIT: |
@sebhildebrandt fixed it! found the issue! submit patch soon... |
after powershell is updated to 7.3.0, almost all methods return empty value now, I guess Wmi-Object command is officially deprecated at this version, and it should be replaced with Get-CimInstance? |
@stalkercn ... i replaced it here on master in GitHub. Can you pull the current master ant test if this works for all functions now on windows? |
@stalkercn ... and just to be sure, this would then work also with older versions of powershell? Ok after making so research starting in PowerShell 3.0, Version 5.12.14 just released where all |
@sebhildebrandt I updated si to v5.12.14, but still got empty values, it's odd. |
We have the following situation on windows machines, where tickets #520, #600, #610, #611, #613, #646, #650 are related to:
wmic
(one of the methods, how this package gained system information) was marked as depricated for some time now. Windows 11 now completely droppedwmic
support. But fortunately there are alternatives.due to problems with international character sets we anyway needed to drop
wmic
and move to the corresponding PowerShell commands. I started this transition with verion 5.9.7.Since version 5.9.10
wmic
is no longer used and all commands now usePowerShell
.I used
powerShell
in systeminformation since verion 3 but did not see any problems so far. But it seems that there are some drawbacks:users
, I now need to make three calls instead of one).As now all commands are rewritten using PowerShell instead of WMIC I made some improvements to tackle some of the problems above (time and CPU consumption). To only spin up a PowerShell instance once, I have created the possibility to enable the persistent power shell:
si.powerShellStart();
si.powerShellRelease();
This improves speed and CPU consumption drastically and removes the problem of cleaning up after each powerShell call.
The text was updated successfully, but these errors were encountered: