Skip to content

Commit

Permalink
refactor(powershell): streamline command construction for Windows upd…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
nistee committed Feb 15, 2025
1 parent 2310014 commit 2ece72a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/steps/powershell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ mod windows {

pub fn windows_update(powershell: &Powershell, ctx: &ExecutionContext) -> Result<()> {
debug_assert!(supports_windows_update(powershell));
let mut cmd = powershell.build_command_internal(ctx, &["Install-WindowsUpdate -Verbose"])?;

let mut args = vec!["Install-WindowsUpdate", "-Verbose"];
if ctx.config().accept_all_windows_updates() {
cmd.arg("-AcceptAll");
args.push("-AcceptAll");
}
cmd.status_checked()

powershell.build_command_internal(ctx, &args)?.status_checked()
}

pub fn microsoft_store(powershell: &Powershell, ctx: &ExecutionContext) -> Result<()> {
Expand Down

0 comments on commit 2ece72a

Please sign in to comment.