Testing/Clear-TestSuite.ps1

function Clear-TestSuite {
    param (
        # The container in which to clear the test suite
        [Parameter(Mandatory=$false)]
        [string]
        $ContainerName = (Get-ContainerFromLaunchJson),
        # The name of the company in which to call the service
        [Parameter(Mandatory=$false)]
        [string]
        $CompanyName = '',
        # The name of the test suite to be cleared
        [Parameter(Mandatory=$false)]
        [string]
        $TestSuite = 'DEFAULT',
        # Credential to use
        [Parameter(Mandatory=$false)]
        [PSCredential]
        $Credential = (New-CredentialFromEnvironmentJson)
    )
    
    Install-BuildHelper -ContainerName $ContainerName

    if ($CompanyName -eq '') {
        $CompanyName = Get-ContainerCompanyToTest -ContainerName $ContainerName
    }

    $Url = "http://{0}:7047/{1}/WS/{2}/Codeunit/AutomatedTestMgt" -f (Get-NavContainerIpAddress -containerName $ContainerName), (Get-LaunchKeyValue -KeyName 'serverInstance'), $CompanyName
    $AutomatedTestMgt = New-WebServiceProxy -Uri $Url -Credential $Credential
    $AutomatedTestMgt.ClearTestSuite($TestSuite)
}

Export-ModuleMember -Function Clear-TestSuite