Testing/Get-TestCodeunitsInContainer.ps1

function Get-TestCodeunitsInContainer {
    param (
        # Container to load test codeunits into
        [Parameter(Mandatory=$false)]
        [string]
        $ContainerName = (Get-ContainerFromLaunchJson),
        # Credentials to use to connect to web service
        [Parameter(Mandatory=$false)]
        [PSCredential]
        $Credential = (New-CredentialFromEnvironmentJson),
        # Name of the test suite to add the test codeunits to
        [Parameter(Mandatory=$false)]
        [string]
        $TestSuite = '',
        # Start of the range of objects to add
        [Parameter(Mandatory=$false)]
        [int]
        $StartId = ((Get-AppKeyValue -SourcePath (Get-Location) -KeyName 'idrange').from),
        # End of the range of objects to add
        [Parameter(Mandatory=$false)]
        [int]
        $EndId = ((Get-AppKeyValue -SourcePath (Get-Location) -KeyName 'idrange').to)
    )

    Install-BuildHelper -ContainerName $ContainerName
    $CompanyName = Get-ContainerCompanyToTest -ContainerName $ContainerName

    $Url = "http://{0}:7047/NAV/WS/{1}/Codeunit/AutomatedTestMgt" -f (Get-NavContainerIpAddress -containerName $ContainerName), $CompanyName
    Write-Host "Calling $Url to retrieve test codeunits"
    $AutomatedTestMgt = New-WebServiceProxy -Uri $Url -Credential $Credential
    $AutomatedTestMgt.GetTests($TestSuite,$StartId,$EndId)
}

Export-ModuleMember -Function Get-TestCodeunitsInContainer