Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Sources/Winget-AutoUpdate/Winget-Upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if (Test-Network) {
#Compare
if ((Compare-SemVer -Version1 $WAUCurrentVersion -Version2 $WAUAvailableVersion) -lt 0) {
#If new version is available, update it
Write-ToLog "WAU Available version: $WAUAvailableVersion" "DarkYellow"
Write-ToLog "Available WAU version: $WAUAvailableVersion" "DarkYellow"
Update-WAU
}
else {
Expand Down Expand Up @@ -292,7 +292,7 @@ if (Test-Network) {

#Trick under user context when -BypassListForUsers is used
if ($IsSystem -eq $false -and $WAUConfig.WAU_BypassListForUsers -eq 1) {
Write-ToLog "Bypass system list in user context is Enabled."
Write-ToLog "Bypassing the system list in user context is Enabled."
$UseWhiteList = $false
$toSkip = $null
}
Expand All @@ -303,15 +303,15 @@ if (Test-Network) {
foreach ($app in $outdated) {
#if current app version is unknown, skip it
if ($($app.Version) -eq "Unknown") {
Write-ToLog "$($app.Name) : Skipped upgrade because current version is 'Unknown'" "Gray"
Write-ToLog "$($app.Name) : Skipped upgrade because the current version is 'Unknown'" "Gray"
}
#if app is in "include list", update it
elseif ($toUpdate -contains $app.Id) {
Update-App $app -src $Script:WingetSourceCustom
}
#if app with wildcard is in "include list", update it
elseif ($toUpdate | Where-Object { $app.Id -like $_ }) {
Write-ToLog "$($app.Name) is wildcard in the include list."
Write-ToLog "$($app.Name) is wildcarded in the include list."
Update-App $app -src $Script:WingetSourceCustom
}
#else, skip it
Expand All @@ -326,15 +326,15 @@ if (Test-Network) {
foreach ($app in $outdated) {
#if current app version is unknown, skip it
if ($($app.Version) -eq "Unknown") {
Write-ToLog "$($app.Name) : Skipped upgrade because current version is 'Unknown'" "Gray"
Write-ToLog "$($app.Name) : Skipped upgrade because the current version is 'Unknown'" "Gray"
}
#if app is in "excluded list", skip it
elseif ($toSkip -contains $app.Id) {
Write-ToLog "$($app.Name) : Skipped upgrade because it is in the excluded app list" "Gray"
}
#if app with wildcard is in "excluded list", skip it
elseif ($toSkip | Where-Object { $app.Id -like $_ }) {
Write-ToLog "$($app.Name) : Skipped upgrade because it is *wildcard* in the excluded app list" "Gray"
Write-ToLog "$($app.Name) : Skipped upgrade because it is *wildcarded* in the excluded app list" "Gray"
}
# else, update it
else {
Expand All @@ -344,12 +344,12 @@ if (Test-Network) {
}

if ($InstallOK -gt 0) {
Write-ToLog "$InstallOK apps updated ! No more update." "Green"
Write-ToLog "$InstallOK apps updated! No more updates." "Green"
}
}

if ($InstallOK -eq 0 -or !$InstallOK) {
Write-ToLog "No new update." "Green"
Write-ToLog "No new updates." "Green"
}

# Test if _WAU-mods-postsys.ps1 exists: Mods for WAU (postsys) - if Network is active/any Winget is installed/running as SYSTEM _after_ SYSTEM updates
Expand Down Expand Up @@ -382,8 +382,8 @@ if (Test-Network) {
}
}
else {
Write-ToLog "Critical: Winget not installed or detected, exiting..." "red"
New-Item "$WorkingDir\logs\error.txt" -Value "Winget not installed or detected" -Force
Write-ToLog "Critical: Winget is not installed or detected, exiting..." "red"
New-Item "$WorkingDir\logs\error.txt" -Value "Winget is not installed or detected" -Force
Write-ToLog "End of process!" "Cyan"
Exit 1
}
Expand Down
Loading