Skip to main content

Configure Winget Auto Update

Summary

This agent procedure is designed to update third-party applications available via Winget.

This solution aims to resolve a common issue with third-party applications not being updated and configures the Winget-AutoUpdate solution on the endpoint with the parameters set. This solution has several configurable parameters detailed below.

Refer to Winget-AutoUpdate for detailed information on Winget-AutoUpdate.

The default for Winget-AutoUpdate is to perform a check daily at 6 AM.

Implementation

  1. Export the procedure from ProVal's VSA instance:
    Name: Winget Auto Update
    Export Procedure
    The export will download the necessary XML file.
    Download XML

  2. Import this procedure into the partner's VSA instance.
    Import Procedure

  3. Upload the PS1 to the partner's VSA. A copy is located in this document in addition to our VSA.
    Upload PS1

  4. Ensure the procedure is updated to point to the PS1 file uploaded to the partner's VSA.
    Update Procedure

    After selecting the PS1 file, the path will default back to the Kaseya default:
    #vAgentConfiguration.agentTempSecureDir#/Winget-AutoUpdate.ps1

    Ensure the portion on the right reads: #directory#//#ScriptName#.ps1
    Check Path

Usage

The Winget AutoUpdate solution can be configured via the #PowerShellCommand# variable.

As this solution requires an import of a PS1 managed file, it is recommended to configure the #PowerShellCommand# variable to match the partner's needs at the time of import.

PowerShell Command

The default for Winget Auto Update is to:

  • Update System Level Applications
  • Update daily at 06 AM

It is recommended to determine the partner's needs and adjust this as required. The settings below have been saved in our VSA and serve as a good basis.

The following example has been saved in our VSA:
#ScriptName#.ps1 -updatesInterval Daily -updatesAtTime 02PM -installUserContext -updatesAtLogon

  • Update System Level & User Context Applications
  • Update daily at 02 PM
  • Additionally update at user logon

Dependencies

Winget-AutoUpdate GitHub Repository

Variables

NameDescription
procedureNameWinget-AutoUpdate
workingDirectoryC:/ProgramData/_automation/script/Winget-AutoUpdate
ps1PathC:/ProgramData/_automation/script/Winget-AutoUpdate/Winget-AutoUpdate.ps1

Parameters

NameExampleOptionsDescription
-InstallUserContext-InstallUserContextAdd this parameter to enable auto-update for User-level applications. By default, only system-level applications are updated. Note: End users may observe a PowerShell window appearing on their screens during the scheduled update if the user context is enabled.
-updatesAtLogon-updatesAtLogonAdd this parameter to configure WAU to run at user logon. Both UpdatesAtTime and UpdatesAtLogon can be used together.
-NotificationLevel-NotificationLevel NoneFull, SuccessOnly, NoneSpecifies the notification level for application updates. Default: None. Sample Notification: Sample Notification
-UpdateInterval-UpdateInterval DailyDaily, BiDaily, Weekly, BiWeekly, Monthly, NeverSpecifies the frequency of updates for the applications. This parameter defines how frequently the available updates are checked and implemented for the applications. Default: Daily
-UpdatesAtTime-UpdatesAtTime 06AM12AM, 12:30AM, 01AM, 01:30AM, 02AM, 02:30AM, 03AM, 03:30AM, 04AM, 04:30AM, 05AM, 05:30AM, 06AM, 06:30AM, 07AM, 07:30AM, 08AM, 08:30AM, 09AM, 09:30AM, 10AM, 10:30AM, 11AM, 11:30AM, 12PM, 12:30PM, 01PM, 01:30PM, 02PM, 02:30PM, 03PM, 03:30PM, 04PM, 04:30PM, 05PM, 05:30PM, 06PM, 06:30PM, 07PM, 07:30PM, 08PM, 08:30PM, 09PM, 09:30PM, 10PM, 10:30PM, 11PM, 11:30PMSpecifies the time for updates in 12-hour format for updating the applications. Default: 06 AM
-doNotRunAfterInstallation-doNotRunAfterInstallationAdd this parameter to prevent Winget-AutoUpdate from running immediately after installation. By default, it runs after installation.
-whitelistedApp-whitelistedApp Ditto.Ditto, Greenshot.Greenshot, HeidiSQL.HeidiSQL, 7zip.7zip, Python.Python.3.12, Mozilla.Firefox*A comma-separated list of applications to update. By default, the solution will enable the Auto-update for all applications unless a whitelist is defined. Specifying this list overrides the blacklisted applications.
-blacklistedApp-blacklistedApp Ditto.Ditto, Greenshot.Greenshot, HeidiSQL.HeidiSQL, 7zip.7zipA comma-separated list of applications to exclude. Only one of Whitelist or Blacklist can be used at a time. If both are provided, Whitelist will take precedence.
-Force-ForceThe agent procedure's default nature is to compare the existing configuration before running the installation. Adding the Force parameter will skip the comparison.
-Uninstall-UninstallTo uninstall Winget-AutoUpdate and wipe its traces, add this parameter.

Output

  • Agent procedure logs

    • C:/ProgramData/_automation/script/Winget-AutoUpdate/Winget-AutoUpdate-log.txt
    • C:/ProgramData/_automation/script/Winget-AutoUpdate/Winget-AutoUpdate-error.txt
  • Scheduled tasks created under /WAU/:

    • Winget-AutoUpdate
    • Winget-AutoUpdate-Notify
    • Winget-AutoUpdate-Policies
    • Winget-AutoUpdate-UserContext

File Hash

File Path: C:/ProgramData/_Automation/script/Winget-AutoUpdate/Winget-AutoUpdate.ps1
File Hash (Sha256): DCC8DF84B0145829B31B89BA047A786C42189C4598C4C458E7D575D7DC1985EF
File Hash (MD5): 07DFAD0A66AA5A4B40C946DF727BE3D8

Attachments

Winget-AutoUpdate.ps1