Core/ModuleTracker.ps1

# Core\ModuleTracker.ps1
# Tracks what Posh ecosystem modules are installed

$script:PoshKnownModules = @(
    @{ Name = 'PoshWallpaper';  Description = 'Animated desktop wallpaper manager'; Repo = 'Jakoby/PoshWallpaper' }
    @{ Name = 'PoshConsole';    Description = 'PowerShell terminal emulator';        Repo = 'Jakoby/PoshConsole'   }
    @{ Name = 'PoshPresenter';  Description = 'HTML-based presentation engine';      Repo = 'Jakoby/PoshPresenter' }
)

function Get-PoshModules {
    <#
    .SYNOPSIS
        List all known Posh ecosystem modules and their install status.
    .EXAMPLE
        Get-PoshModules
    .EXAMPLE
        Get-PoshModules | Where-Object Installed
    #>

    [CmdletBinding()]
    param()

    foreach ($mod in $script:PoshKnownModules) {
        $found     = Get-Module -ListAvailable -Name $mod.Name -ErrorAction SilentlyContinue
        $installed = $null -ne $found
        $version   = if ($installed) {
            ($found | Sort-Object Version -Descending | Select-Object -First 1).Version.ToString()
        } else { $null }

        [PSCustomObject]@{
            Name        = $mod.Name
            Description = $mod.Description
            Installed   = $installed
            Version     = $version
            Repo        = $mod.Repo
        }
    }
}

Write-Verbose "ModuleTracker loaded"