-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually find powershell.exe or pwsh.exe on path
Some windows systems have pwsh.exe but not powershell.exe. For the purpose of this library, both executables have interchangeable functionality so we can fall back to pwsh.exe when powershell.exe is not present. It is also possible that neither powershell.exe nor pwsh.exe is availble on the path. When that is the case, we can fall back to looking them up in the default system locations: C:\Program Files\PowerShell\* and C:\\Windows\\System32\\WindowsPowerShell\\v1.0. On my windows vm, powershell.exe and pwsh.exe are both available but powershell.exe is noticeably faster to execute this command (running test takes about 3 seconds with pwsh.exe and 1 seconds with powershell.exe). For this reason, I made it so that powershell.exe is preferred over pwsh.exe if it is available.
- Loading branch information
Showing
1 changed file
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters