Name instead of ID...

pull/136/head
KnifMelti 2022-08-04 22:12:43 +02:00
parent 5f852d986d
commit 6b961ce22e
1 changed files with 3 additions and 3 deletions

View File

@ -32,14 +32,14 @@ Function Update-App ($app) {
#Test for a Pending Reboot (Component Based Servicing/WindowsUpdate/CCM_ClientUtilities) #Test for a Pending Reboot (Component Based Servicing/WindowsUpdate/CCM_ClientUtilities)
$PendingReboot = Test-PendingReboot $PendingReboot = Test-PendingReboot
if ($PendingReboot -eq $true) { if ($PendingReboot -eq $true) {
Write-Log "A Pending Reboot lingers and probably prohibited $($app.Id) from upgrading..." "Red" Write-Log "A Pending Reboot lingers and probably prohibited $($app.Name) from upgrading..." "Red"
Write-Log "...an install for $($app.Id) is NOT executed!" "Red" Write-Log "...an install for $($app.Name) is NOT executed!" "Red"
$FailedToUpgrade = $true $FailedToUpgrade = $true
break break
} }
#If app failed to upgrade, run Install command #If app failed to upgrade, run Install command
Write-Log "An upgrade for $($app.Id) failed, now trying an install..." "Yellow" Write-Log "An upgrade for $($app.Name) failed, now trying an install..." "Yellow"
& $Winget install --id $($app.Id) --accept-package-agreements --accept-source-agreements -h | Tee-Object -file $LogFile -Append & $Winget install --id $($app.Id) --accept-package-agreements --accept-source-agreements -h | Tee-Object -file $LogFile -Append
#Set mods to apply as an install #Set mods to apply as an install