WinGet is a powerful tool for managing applications on Windows, capable of fetching the latest version information. However, in practice, there are many programs that receive frequent minor updates, which are not necessarily critical. Users often prefer to update only major or minor versions manually, which can be inconvenient. To address this, a PowerShell script has been developed to automate the update process for major and minor changes.
PowerShell Script for Winget Update
The script, named winget_update_major_minor_change.ps1, can be downloaded from here.
The script begins by defining a function GetVersion to extract major and minor version numbers from a version string. It then clears the screen and runs the winget list command to retrieve a list of installed applications.
For each application, the script checks the installed version and the latest available version. If the latest version is a major or minor update, the script proceeds to update the application silently, accepting all package and source agreements.
Usage
To use the script, save it as winget_update_major_minor_change.ps1 and run it in PowerShell with administrative privileges. The script will automatically identify and update applications that have available major or minor updates.
Conclusion
The Winget update script provides a convenient way to manage application updates, ensuring that only major and minor changes are applied. This automation saves time and reduces the risk of missing important updates. By using this script, users can maintain their system with minimal manual intervention, ensuring that all applications are up-to-date without unnecessary disruptions.