@@ -181,16 +181,17 @@ Function Confirm-RSWinGet {
181
181
# Checking if the installed version of WinGet are the same as the latest version of WinGet
182
182
[version ]$vWinGet = [string ]$SysInfo.WinGet
183
183
[version ]$vGitHub = [string ]$GitHubInfo.Tag
184
+ if ($WinGet -ne " 1.19.3531.0" ) {
185
+ if ([Version ]$vWinGet -lt [Version ]$vGitHub ) {
186
+ Write-Output " WinGet has a newer version $ ( $GitHubInfo.Tag ) , downloading and installing it..."
187
+ Invoke-WebRequest - UseBasicParsing - Uri $GitHubInfo.DownloadUrl - OutFile $GitHubInfo.OutFile
184
188
185
- if ([Version ]$vWinGet -lt [Version ]$vGitHub -or $WinGet -like " 1.19.3531.0" ) {
186
- Write-Output " WinGet has a newer version $ ( $GitHubInfo.Tag ) , downloading and installing it..."
187
- Invoke-WebRequest - UseBasicParsing - Uri $GitHubInfo.DownloadUrl - OutFile $GitHubInfo.OutFile
188
-
189
- Write-Output " Installing version $ ( $GitHubInfo.Tag ) of WinGet..."
190
- Add-AppxPackage $ ($GitHubInfo.OutFile )
191
- }
192
- else {
193
- Write-OutPut " Your already on the latest version of WinGet $ ( $WinGet ) , no need to update."
189
+ Write-Output " Installing version $ ( $GitHubInfo.Tag ) of WinGet..."
190
+ Add-AppxPackage $ ($GitHubInfo.OutFile )
191
+ }
192
+ else {
193
+ Write-OutPut " Your already on the latest version of WinGet $ ( $WinGet ) , no need to update."
194
+ }
194
195
}
195
196
}
196
197
Function Get-RSInstallInfo {
@@ -249,7 +250,7 @@ Function Get-RSInstallInfo {
249
250
# Collects everything in pscustomobject to get easier access to the information
250
251
[System.Object ]$SysInfo = [PSCustomObject ]@ {
251
252
VCLibs = $ (Get-AppxPackage - Name " Microsoft.VCLibs.140.00" - AllUsers | Where-Object { $_.Architecture -eq $Arch })
252
- WinGet = $ (try { (Get-AppxPackage - AllUsers | Where-Object { $_.name -like " Microsoft.DesktopAppInstaller " } | Sort-Object { $_.Version -as [version ] } - Descending | Select-Object Version - First 1 ).version } catch { " 0.0.0.0" })
253
+ WinGet = $ (try { (Get-AppxPackage - AllUsers | Where-Object { $_.PackageFamilyName -like " Microsoft.DesktopAppInstaller_8wekyb3d8bbwe " } | Sort-Object { $_.Version -as [version ] } - Descending | Select-Object Version - First 1 ).version } catch { " 0.0.0.0" })
253
254
VisualCRedistUrl = $VisualCRedistUrl
254
255
VCLibsUrl = $VCLibsUrl
255
256
Arch = $Arch
0 commit comments