Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Start scanning for updates
- Write-Host "Scanning for updates..."
- usoclient StartScan
- # Wait for scan to complete (optional, adjust timing as needed)
- Start-Sleep -Seconds 10
- # Check for pending updates using WMI
- $UpdatesPending = Get-WmiObject -Namespace "Root\cimv2" -Query "Select * from Win32_QuickFixEngineering" | Where-Object { $_.HotFixID -eq "" }
- if ($UpdatesPending) {
- Write-Host "Updates found. Starting download..."
- usoclient StartDownload
- Write-Host "Downloading updates. Starting installation..."
- usoclient StartInstall
- } else {
- Write-Host "No updates found."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement