Skip to main content

Application - Latest Version Detection

Summary​

This script is designed to gather the latest version of applications supported by Winget and store them in the system properties created with the name of the PackageID.

Dependencies​

Sample Run​

Sample Run

Variables​

NameValueDescription
ProjectNameGet-WingetPackageLatestVersionScript project name
WorkingDirectoryC:\ProgramData_Automation\Script\Get-WingetPackageLatestVersionScript working directory
PS1PathC:\ProgramData_Automation\Script\Get-WingetPackageLatestVersion\Get-WingetPackageLatestVersion.ps1Script file path
appNamewingetApplication name
appDirectoryC:\ProgramData_Automation\app\wingetDirectory for app files
extractPathC:\ProgramData_Automation\app\winget\ExtractPath for extracted files
executablePathC:\ProgramData_Automation\app\winget\ExecutablePath for executables
appPathC:\ProgramData_Automation\app\winget\Executable\winget.exeFull path to winget.exe
installerPathC:\ProgramData_Automation\app\winget\InstallersPath for installer files
msixBundleMicrosoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundleMSIX bundle filename
msixBundlePathC:\ProgramData_Automation\app\winget\Installers\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundleFull path to MSIX bundle
msixBundleDownloadUrlhttps://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundleDownload URL for MSIX bundle
7zrExePathC:\ProgramData_Automation\app\winget\Installers\7zr.exePath to 7zr.exe
7zrExtra7zPathC:\ProgramData_Automation\app\winget\Installers\7z.7zPath to 7z.7z archive
7zaPathC:\ProgramData_Automation\app\winget\Installers\7za.exePath to 7za.exe
7zrExeDownloadUrlhttps://github.com/ProVal-Tech/7zip/releases/latest/download/7zr.exeDownload URL for 7zr.exe
7zrExtra7zDownloadUrlhttps://github.com/ProVal-Tech/7zip/releases/latest/download/7zExtra.7zDownload URL for 7z extra archive
appInstallerX64PathC:\ProgramData_Automation\app\winget\Extract\AppInstaller_x64.msixPath to extracted AppInstaller x64
appInstallerX86PathC:\ProgramData_Automation\app\winget\Extract\AppInstaller_x86.msixPath to extracted AppInstaller x86
vcRunTimePackageC:\ProgramData_Automation\app\winget\Installers\Microsoft.VCLibs.x64.14.00.Desktop.appxPath to VC runtime package
vcRunTimePackageDownloadUrlhttps://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appxDownload URL for VC runtime package
visual2019RedirMicrosoft Visual C++ 2015-2019 RedistributableName of Visual C++ 2015-2019 Redistributable
visual2022RedirMicrosoft Visual C++ 2015-2022 RedistributableName of Visual C++ 2015-2022 Redistributable
vcRedistExecutableVC_redist.x64.exe or VC_redist.x86.exe (depends on OS architecture)Visual C++ Redistributable installer filename
vcRedistExecutablePathC:\ProgramData_Automation\app\winget\Installers\VC_redist.x64.exe (or .x86.exe)Path to Visual C++ Redistributable installer
vcRedistExecutableDownloadUrlhttps://aka.ms/vs/17/release/VC_redist.x64.exe (or .x86.exe)Download URL for Visual C++ Redistributable installer

User Parameters​

NameExampleRequiredDescription
PackageIDMicrosoft.RemoteDesktopClientFalseThe parameter passes the value to the script for the PackageID application version detection

System Properties​

NameExampleRequiredDescription
@PackageID@Microsoft.RemoteDesktopClientFalseThis automatically gets created by the script once the PackageID version is detected with the PackageID name

Output​

  • Script log

Changelog​

2026-04-06​

  • Code signed PowerShell script
  • Updated the downloadUrl for both 7zr.exe and 7z.7z

2025-07-11​

  • Updated the script to use file write method and then added the hash to the doc.

2025-04-10​

  • Initial version of the document