Skip to main content

Application - Latest Version Detection [Winget]

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.

File Hash

File Path: C:\ProgramData\_automation\Script\Get-WingetPackageLatestVersion\Get-WingetPackageLatestVersion.ps1
File Hash (Sha256): 88C430DB16D0CD9E76C3B3650E76F6D7B06C79F42678F2C65138687EA9C546E7
File Hash (MD5): 885A601D6A2A0EA69C8073C165FBAB54

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://www.7-zip.org/a/7zr.exeDownload URL for 7zr.exe
7zrExtra7zDownloadUrlhttps://www.7-zip.org/a/7z2201-extra.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