Public/Get-P1Packages.ps1

function Get-P1Packages {
    <#
    .Synopsis
    List all available packages from PlannerOne NuGet server.

    .Description
    Connect to remote repository and list the latest release.
    #>

    [cmdletbinding()]
    param( 
    )    
    Process {
        Write-Verbose "Reading PlannerOne package from repository..."
        $feedUrl = Get-FeedUrl
        if ($feedUrl -eq "") {
            return
        }

        
        if (Get-Command Find-Package -errorAction SilentlyContinue)
        {
            Write-Verbose "Find-Package exists"
            $packages = Find-Package -Source $feedUrl
        } else {
            Write-Verbose "Find-Package doesn't exist, using NuGet"
            $packages = NuGet list -Source $feedUrl
        }

        return $packages
    }
}