J2897 icon

Update Windows

J2897 | PRO | 11/26/24 12:55:34 AM UTC | 1 ⭐ | 7700 👁️ | Never ⏰ | []
PowerShell |

600 B

|

None

|

1 👍

/

0 👎

# 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."
}
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎