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

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

$publicPath = Join-Path $PSScriptRoot 'Public'
if (Test-Path $publicPath) {
    Get-ChildItem -Path $publicPath -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'
)