xref: /aosp_15_r20/external/crosvm/prebuilts/src/sys/windows.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
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) -> Command8 pub(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