branch: elpa/powershell
commit 87826777bd3ebd53740be99b4546bfc11ccc625d
Author: xeijin <[email protected]>
Commit: Joe Schafer <[email protected]>

    Programmatically find powershell executable (#25)
    
    And make this cross platform (i.e. works with PowerShell Core for 
Linux/macOS)
---
 powershell.el | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/powershell.el b/powershell.el
index 04c773c1bf3..257da43c50a 100644
--- a/powershell.el
+++ b/powershell.el
@@ -783,14 +783,12 @@ that value is non-nil."
   (powershell-setup-menu)
   (powershell-setup-eldoc))
 
-
 ;;; PowerShell inferior mode
 
-;; TODO: set this programmatically, relying on %WINDIR%
 ;;; Code:
 (defcustom powershell-location-of-exe
-  "c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
-  "A string, providing the location of the powershell.exe."
+   (or (executable-find "powershell") (executable-find "pwsh"))
+  "A string, providing the location of the powershell executable."
   :group 'powershell)
 
 (defcustom powershell-log-level 3

Reply via email to