Skip to content

pwsh is not default installed #1

@martianzhang

Description

@martianzhang

src\main.rs

3118fn detect_shell() -> CommandBuilder {
3119let pwsh = which::which("pwsh").ok().map(|p| p.to_string_lossy().into_owned());
3120let cmd = which::which("cmd").ok().map(|p| p.to_string_lossy().into_owned());
3121match pwsh.or(cmd) {
3122Some(path) => CommandBuilder::new(path),
3123None => CommandBuilder::new("pwsh.exe"),
3124}
3125}

detect_shell only check and use pwsh or cmd, doesn't check powershell.

Get-Command powershell

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     powershell.exe                                     10.0.26... C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

temporary fix method

# install pwsh 7+
winget install --id Microsoft.PowerShell

may be should add powershell into detect_shell check sequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions