Skip to content

MichaMican/winget-auto-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Winget AutoUpdate

Update your apps automatically on start with winget.

Preable

As there is no native auto update support via winget - i have created this PowerShell which can be configured to update selected Apps in controlled way.

Dependencies

PowerShell Modules

  • Microsoft.WinGet.Client

Setup

  1. Make sure that Microsoft.WinGet.Client is installed on you machine.
Install-Module Microsoft.WinGet.Client
  1. Save WingetAutoUpdate.ps1 somewhere on your device.
  2. Make sure it is unblocked.
    image
  3. Create a file called WingetAutoUpdateConfig.json somewhere on you device and populate it according to your needs. You can take a look at WingetAutoUpdateConfigExample.json for reference.
  4. Open Task Scheduler.
  5. Click "Create Task".
  6. Configure as follows:
    1. General
      1. Name: WingetAutoUpdate
      2. Run only when user is logged on
      3. Run with highes privilages: true (optional: if not set the updates might prompt you for admin privilages)
    2. Triggers (New)
      1. Begin the task: At log on
      2. Delay task for: 30 seconds
      3. Stop task if it runs longer than: 1 hour
    3. Actions (New)
      1. Action: Start a programm
      2. Program/script: powershell.exe or pwsh.exe (Make sure that you do not update PowerShell 7 through this auto updater if you use pwsh.exe here)
      3. Add arguments: -File "<Path to WingetAutoUpdate.ps1 on your machine>" -ConfigPath <Path to your WingetAutoUpdateConfig.json>

Config

The config can be any json file with the following format:

{
    "rules":[
        // rule objects
    ]
}

Rule

Property Mandatory Description
package [x] String name of the Package that should be updated
version [x] String version matrix, that defines if a version is allowed to be updated.
literal [ ] boolean that defines if the value defined in package should be used as a search term or as an id (literally). I recommend to always set this to true

Version Matrix

x = Version number has to stay the same

  • = Version number can change
    Example: Assuming we have a software with version 1.2.3.4 and a version mask of x.x..
  • 1.2.3.5: Will update
  • 1.2.4.0: Will update
  • 1.3.2.3: Will not update
  • 2.0.0.0: Will not update

About

Update your apps automatically on start with winget

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors