Run Windows update specifically in the Windows powershell
This commit is contained in:
@@ -587,7 +587,7 @@ fn run() -> Result<(), Error> {
|
|||||||
execute(
|
execute(
|
||||||
&mut report,
|
&mut report,
|
||||||
"Windows update",
|
"Windows update",
|
||||||
|| powershell.windows_update(run_type),
|
|| powershell::Powershell::windows_powershell().windows_update(run_type),
|
||||||
config.no_retry(),
|
config.no_retry(),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ impl Powershell {
|
|||||||
Powershell { path, profile }
|
Powershell { path, profile }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
pub fn windows_powershell() -> Self {
|
||||||
|
Powershell {
|
||||||
|
path: which("powershell").filter(|_| !is_dumb()),
|
||||||
|
profile: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn has_module(powershell: &PathBuf, command: &str) -> bool {
|
pub fn has_module(powershell: &PathBuf, command: &str) -> bool {
|
||||||
Command::new(&powershell)
|
Command::new(&powershell)
|
||||||
|
|||||||
Reference in New Issue
Block a user