mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-10 01:51:18 +10:00
* Update Invoke-WPFGetInstalled.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Delete functions/private/Test-WinUtilPackageManager.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilChoco.ps1 * Update Invoke-WPFGetInstalled.ps1 * Update Invoke-WPFGetInstalled.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilWinget.ps1 * Fixed lastrun.json * refactor: remove PackageManagers enum and unused custom exception classes * Update Invoke-WPFUIElements.ps1 * Update Get-WinUtilSelectedPackages.ps1 * Update Set-Preferences.ps1 * Update main.ps1 * Complete package manager enum removal Use string package-manager preferences throughout the remaining helpers and focused tests. Restore the existing Winget install flow and package-manager probe helper so PR 4606 keeps the current WinGet repair method. * Fix string keyed package split --------- Co-authored-by: Chris Titus <contact@christitus.com>
29 lines
1.0 KiB
PowerShell
29 lines
1.0 KiB
PowerShell
function Get-WinUtilPackageLogSummary {
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[object[]]$Packages,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Preference
|
|
)
|
|
|
|
@($Packages | ForEach-Object {
|
|
$package = $_
|
|
$packageName = @($package.Name, $package.Description, $package.winget, $package.choco) |
|
|
Where-Object { -not [string]::IsNullOrWhiteSpace([string]$_) -and $_ -ne "na" } |
|
|
Select-Object -First 1
|
|
|
|
if ([string]::IsNullOrWhiteSpace([string]$packageName)) {
|
|
$packageName = "Unknown package"
|
|
}
|
|
|
|
if ($Preference -eq "Choco" -and -not [string]::IsNullOrWhiteSpace([string]$package.choco) -and $package.choco -ne "na") {
|
|
"$packageName (choco: $($package.choco))"
|
|
} elseif (-not [string]::IsNullOrWhiteSpace([string]$package.winget) -and $package.winget -ne "na") {
|
|
"$packageName (winget: $($package.winget))"
|
|
} else {
|
|
"$packageName (no package id)"
|
|
}
|
|
})
|
|
}
|