diff --git a/src/main.rs b/src/main.rs index 5803fc75..139ccb73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -587,7 +587,7 @@ fn run() -> Result<(), Error> { execute( &mut report, "Windows update", - || powershell.windows_update(run_type), + || powershell::Powershell::windows_powershell().windows_update(run_type), config.no_retry(), )?; } diff --git a/src/steps/powershell.rs b/src/steps/powershell.rs index bc40546a..6b5cdd89 100644 --- a/src/steps/powershell.rs +++ b/src/steps/powershell.rs @@ -32,6 +32,14 @@ impl Powershell { Powershell { path, profile } } + #[cfg(windows)] + pub fn windows_powershell() -> Self { + Powershell { + path: which("powershell").filter(|_| !is_dumb()), + profile: None, + } + } + #[cfg(windows)] pub fn has_module(powershell: &PathBuf, command: &str) -> bool { Command::new(&powershell)