fix incorrect commit
parent
d5dd6ef76f
commit
4fee69a5d9
|
@ -269,24 +269,27 @@ if (Test-Network){
|
||||||
Start-NotifTask $Title $Message $MessageType $Balise
|
Start-NotifTask $Title $Message $MessageType $Balise
|
||||||
|
|
||||||
#Winget upgrade
|
#Winget upgrade
|
||||||
Write-Log "########## WINGET PROCESS STARTS FOR '$($app.Name)' ##########" "Gray"
|
Write-Log "########## WINGET UPGRADE PROCESS STARTS FOR '$($app.Name)' ##########" "Gray"
|
||||||
& $UpgradeCmd upgrade --id $($app.Id) --all --accept-package-agreements --accept-source-agreements -h | Tee-Object -file $LogFile -Append
|
#Run Winget Upgrade command
|
||||||
$checkoutdated = Get-WingetOutdated
|
& $UpgradeCmd upgrade --id $($app.Id) --all --accept-package-agreements --accept-source-agreements -h | Tee-Object -file $LogFile -Append
|
||||||
foreach ($checkapp in $checkoutdated){
|
|
||||||
if ($($checkapp.Id) -eq $($app.Id)) {
|
|
||||||
$FailedToUpgrade = $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Log "########## WINGET PROCESS FINISHED FOR '$($app.Name)' ##########" "Gray"
|
|
||||||
|
|
||||||
#Check installed version
|
#Check if application updated properly
|
||||||
$checkoutdated = Get-WingetOutdated
|
$CheckOutdated = Get-WingetOutdated
|
||||||
$FailedToUpgrade = $false
|
$FailedToUpgrade = $false
|
||||||
foreach ($checkapp in $checkoutdated){
|
foreach ($CheckApp in $CheckOutdated){
|
||||||
if ($($checkapp.Id) -eq $($app.Id)) {
|
if ($($CheckApp.Id) -eq $($app.Id)) {
|
||||||
$FailedToUpgrade = $true
|
#If app failed to upgrade, run Install command
|
||||||
|
& $upgradecmd install --id $($app.Id) --accept-package-agreements --accept-source-agreements -h | Tee-Object -file $LogFile -Append
|
||||||
|
#Check if application installed properly
|
||||||
|
$CheckOutdated2 = Get-WingetOutdated
|
||||||
|
foreach ($CheckApp2 in $CheckOutdated2){
|
||||||
|
if ($($CheckApp2.Id) -eq $($app.Id)) {
|
||||||
|
$FailedToUpgrade = $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
Write-Log "########## WINGET UPGRADE PROCESS FINISHED FOR '$($app.Name)' ##########" "Gray"
|
||||||
|
|
||||||
#Notify installation
|
#Notify installation
|
||||||
if ($FailedToUpgrade -eq $false){
|
if ($FailedToUpgrade -eq $false){
|
||||||
|
|
Loading…
Reference in New Issue