windows update, use explicit reboot policy (#1143)
This commit is contained in:
@@ -156,6 +156,7 @@ impl Powershell {
|
||||
#[cfg(windows)]
|
||||
mod windows {
|
||||
use super::*;
|
||||
use crate::config::UpdatesAutoReboot;
|
||||
|
||||
pub fn supports_windows_update(powershell: &Powershell) -> bool {
|
||||
powershell
|
||||
@@ -174,6 +175,11 @@ mod windows {
|
||||
if ctx.config().accept_all_windows_updates() {
|
||||
command_str.push_str(" -AcceptAll");
|
||||
}
|
||||
match ctx.config().windows_updates_auto_reboot() {
|
||||
UpdatesAutoReboot::Yes => command_str.push_str(" -AutoReboot"),
|
||||
UpdatesAutoReboot::No => command_str.push_str(" -IgnoreReboot"),
|
||||
UpdatesAutoReboot::Ask => (), // Prompting is the default for Install-WindowsUpdate
|
||||
}
|
||||
|
||||
// Pass the command string using the -Command flag
|
||||
powershell
|
||||
|
||||
Reference in New Issue
Block a user