Run Windows update with Powershell using sudo (fix #477) (#481)

This commit is contained in:
Roey Darwish Dror
2020-07-20 15:23:25 +03:00
committed by GitHub
parent bc9ab413b8
commit 0cfae3d5eb

View File

@@ -81,8 +81,15 @@ impl Powershell {
debug_assert!(self.supports_windows_update());
ctx.run_type()
.execute(&powershell)
let mut command = if let Some(sudo) = ctx.sudo() {
let mut command = ctx.run_type().execute(sudo);
command.arg(&powershell);
command
} else {
ctx.run_type().execute(&powershell)
};
command
.args(&[
"-Command",
&format!(