Function which

Source
pub fn which(
    name: impl AsRef<OsStr>,
    paths: &str,
    cwd: &Path,
) -> Option<PathBuf>
Expand description

Searches for the absolute path of an executable by name. .bat and .cmd files are recognized as executables on Windows.

This is a wrapper around which::which_in() except that, on Windows, it also searches the current directory before any PATH entries.

Note: the which.rs crate always uses PATHEXT from the environment. As such, changing PATHEXT within Nushell doesn’t work without updating the actual environment of the Nushell process.