PSModuleBrowser.psm1


class GalleryModuleInfo {
    [string]$Name
    [string]$Version
    [string]$InstalledVersion
    [string]$Author
    [string]$Description
    [string]$ProjectUri
    [string]$LicenseUri
    [string[]]$Tags
    [datetime]$PublishedDate
    [long]$DownloadCount
    [bool]$IsPrerelease
    [string[]]$Dependencies
    [string]$Repository
    [string]$InstallStatus  # 'Installed', 'UpdateAvailable', 'NotInstalled'
    [string[]]$ExportedCommands
}

$script:ModuleProvider = $null
$script:PSMBHeaderModelCache = $null
$script:PSMBModuleRoot = $PSScriptRoot
$script:PSMBLogEnabled = ($env:PSMB_DEBUG -eq '1') -or ($env:PSMB_DEBUG -eq 'true')

foreach ($folder in @('Private', 'Public')) {
    $folderPath = Join-Path $PSScriptRoot $folder
    if (Test-Path $folderPath) {
        Get-ChildItem -Path $folderPath -Filter '*.ps1' -Recurse | ForEach-Object {
            try { . $_.FullName } catch { throw "Failed to load '$($_.FullName)': $_" }
        }
    }
}

Export-ModuleMember -Function @(
    'Start-PSModuleBrowser',
    'Search-PSModule',
    'Get-PSModuleInfo',
    'Get-PSModuleVersion',
    'Get-PSModuleDependency',
    'Get-PSModuleCommandPreview',
    'Install-PSModule'
)