Run Windows update specifically in the Windows powershell
This commit is contained in:
@@ -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(),
|
||||
)?;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user