1 // Copyright 2022 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use std::path::Path; 6 use std::process::Command; 7 download_command(url: &str, destination: &Path) -> Command8pub(crate) fn download_command(url: &str, destination: &Path) -> Command { 9 let mut cmd = Command::new("powershell"); 10 cmd.arg("-c").arg(format!( 11 "$wc = New-Object System.Net.WebClient; $wc.DownloadFile(\"{}\", \"{}\")", 12 url, 13 destination.to_str().unwrap() 14 )); 15 cmd 16 } 17