Open the-project-group opened 1 year ago
Just found a small typo: # no upgared, no action needed Detect:
$app_2upgrade = "Mozilla.Firefox" $Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe") if ($(&$winget upgrade) -like "* $app_2upgrade *") { Write-Host "Upgrade available for: $app_2upgrade" exit 1 # upgrade available, remediation needed } else { Write-Host "No Upgrade available" exit 0 # no upgared, no action needed }
Write-Error "Error while installing upgarde for: $app_2upgrade Remediate:
$app_2upgrade = "Mozilla.Firefox" try{ $Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe") # upgrade command &$winget upgrade --exact $app_2upgrade --silent --force --accept-package-agreements --accept-source-agreements exit 0 }catch{ Write-Error "Error while installing upgarde for: $app_2upgrade" exit 1
}
Just found a small typo: # no upgared, no action needed Detect:
Write-Error "Error while installing upgarde for: $app_2upgrade Remediate:
}