Skip to content
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

Switched to PS Core with a legacy PS fallback #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bryanwayb
Copy link

PSCore has a faster load time and offers the same functionality required for find-process over the legacy .NET Framework based versions.

This change is to switched the PowerShell spawning to prioritize PSCore (pwsh.exe) over the legacy PS versions (powershell.exe) by manually performing the binary lookup to pass in to the utils.spawn command before executing. If the pwsh.exe executable exists, it will execute that, and if not it will attempt to find a powershell.exe executable instead. If none is found, an error is thrown.

Milage may vary, but with my local testing I see on average ~450ms of a speed reduction. (The PSCore version taking aprox ~450ms to run, PS Legacy taking ~900ms).

bryanwayb added a commit to bryanwayb/envy that referenced this pull request Jan 30, 2023
Will need to switch back once PR is approved, merged, and deployed: yibn2008/find-process#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant