Emacs Init: Change Default Shell (PowerShell)

By Xah Lee. Date: . Last updated: .
explicit-shell-file-name
variable. A full path to the default shell started by the command shell

sample init to set it to PowerShell

;; on windows, make pwsh the default shell
;; 2023-09-09
(setq
 explicit-shell-file-name
 (cond
  ((eq system-type 'windows-nt)
   (let ((xlist
          (list
           "~/AppData/Local/Microsoft/WindowsApps/pwsh.exe"
           "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
           )))
     (seq-some (lambda (x) (if (file-exists-p x) x nil)) xlist)))
  (t nil)))

Shell in Emacs

Emacs on Microsoft Windows