chore: improve Windows Update step and add PSWindowsUpdate Module (#842)
* chore: improve Windows Update step and add PSWindowsUpdate Module
Refactor the `windows_update` function in `windows.rs` to improve the Windows Update step. Added a prompt for administrator privileges and updated the warning message. Also, added support for installing the PSWindowsUpdate Module as an alternative to using USOClient for Windows Update.
still see warning:
The installer will request to run as administrator, expect a prompt.
Start-Process : A parameter cannot be found that matches parameter name 'Command'.
At line:1 char:74
+ ... ath powershell -Verb runAs -ArgumentList -NoProfile -Command Import- ...
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
VERBOSE: MSI-THIN-GF36 (6/30/2024 4:48:48 PM): Connecting to Microsoft Update server. Please wait...
VERBOSE: Found [0] Updates in pre search criteria
but as the verbose shows it works
* trying
* fix
This commit is contained in:
@@ -204,10 +204,12 @@ pub fn windows_update(ctx: &ExecutionContext) -> Result<()> {
|
||||
print_separator("Windows Update");
|
||||
|
||||
if powershell.supports_windows_update() {
|
||||
println!("The installer will request to run as administrator, expect a prompt.");
|
||||
|
||||
powershell.windows_update(ctx)
|
||||
} else {
|
||||
print_warning(
|
||||
"Consider installing PSWindowsUpdate as the use of Windows Update via USOClient is not supported.",
|
||||
"Consider installing PSWindowsUpdate Module as the use of Windows Update via USOClient is not supported.",
|
||||
);
|
||||
|
||||
Err(SkipStep("USOClient not supported.".to_string()).into())
|
||||
|
||||
Reference in New Issue
Block a user