<commit_before>function Test-BoxstarterPackage {
    [CmdletBinding()]
    param(
        [string[]]$PackageName
    )
    $options = Get-BoxstarterDeployOptions
    if(!$options.DeploymentTargetCredentials){
        throw "No DeploymentTargetCredentials has been sent. Use Set-BoxstarterBuildOptions to set DeploymentTargetCredentials"
    }

    if($options.DeploymentVMProvider -and $options.DeploymentVMProvider -gt 0){
        $vmArgs=@{}
        if($options.DeploymentCloudServiceName){$vmArgs.CloudServiceName=$options.DeploymentCloudServiceName}
        if($options.RestoreCheckpoint){$vmArgs.CheckpointName=$options.RestoreCheckpoint}
        $vmArgs.Provider=$options.DeploymentVMProvider
    }

    $summary=@{
        Total=0
        Passed=0
        Skipped=0
        Failed=0
    }

    if($packageName) {
        $PackageName | % {
            $pkg = $_
            Invoke-BuildAndTest $pkg $options $vmArgs $summary  | % {
                $summary.Total++
                if($_.Status="PASSED") {
                    $summary.Passed++
                }
                else {
                    $summary.Failed++
                }
                New-Object PSObject -Property @{
                    Package=$pkg.Name
                    RepoVersion="---"
                    PublishedVersion="---"
                    TestComputerName=$_.TestComputerName
                    ResultDetails=$_.ResultDetails
                    Status=$_.Status
                }
            }
        }
    }
    else {
        Get-BoxstarterPackages | % {
            $pkg = $_
            if(Test-PackageVersionGreaterThanPublished $pkg) {
                Write-Progress "Installing $pkg.Name. This may take several minutes..."
                Invoke-BuildAndTest $pkg.Name $options $vmArgs $summary | % {
                    $summary.Total++
                    if($_.Status="PASSED") {
                        $summary.Passed++
                    }
                    else {
                        $summary.Failed++
                    }
                    New-Object PSObject -Property @{
                        Package=$pkg.Id
                        RepoVersion=$pkg.Version
                        PublishedVersion=$(if($pkg.PublishedVersion -eq $null) {"Not Published"} else { $pkg.PublishedVersion })
                        TestComputerName=$_.TestComputerName
                        ResultDetails=$_.ResultDetails
                        Status=$_.Status
                    }
                }
            }
            else {
                $summary.Total++
                $summary.Skipped++
                New-Object PSObject -Property @{
                    Package=$pkg.Id
                    RepoVersion=$pkg.Version
                    PublishedVersion=$(if($pkg.PublishedVersion -eq $null) {"Not Published"} else { $pkg.PublishedVersion })
                    TestComputerName=$null
                    ResultDetails=@{}<commit_msg>fix passing package name to test function<commit_after>function Test-BoxstarterPackage {
    [CmdletBinding()]
    param(
        [string[]]$PackageName
    )
    $options = Get-BoxstarterDeployOptions
    if(!$options.DeploymentTargetCredentials){
        throw "No DeploymentTargetCredentials has been sent. Use Set-BoxstarterBuildOptions to set DeploymentTargetCredentials"
    }

    if($options.DeploymentVMProvider -and $options.DeploymentVMProvider -gt 0){
        $vmArgs=@{}
        if($options.DeploymentCloudServiceName){$vmArgs.CloudServiceName=$options.DeploymentCloudServiceName}
        if($options.RestoreCheckpoint){$vmArgs.CheckpointName=$options.RestoreCheckpoint}
        $vmArgs.Provider=$options.DeploymentVMProvider
    }

    $summary=@{
        Total=0
        Passed=0
        Skipped=0
        Failed=0
    }

    if($packageName) {
        $PackageName | % {
            $pkg = $_
            Invoke-BuildAndTest $pkg $options $vmArgs $summary  | % {
                $summary.Total++
                if($_.Status="PASSED") {
                    $summary.Passed++
                }
                else {
                    $summary.Failed++
                }
                New-Object PSObject -Property @{
                    Package=$pkg.Name
                    RepoVersion="---"
                    PublishedVersion="---"
                    TestComputerName=$_.TestComputerName
                    ResultDetails=$_.ResultDetails
                    Status=$_.Status
                }
            }
        }
    }
    else {
        Get-BoxstarterPackages | % {
            $pkg = $_
            if(Test-PackageVersionGreaterThanPublished $pkg) {
                Write-Progress "Installing $pkg.Name. This may take several minutes..."
                Invoke-BuildAndTest $pkg.Id $options $vmArgs $summary | % {
                    $summary.Total++
                    if($_.Status="PASSED") {
                        $summary.Passed++
                    }
                    else {
                        $summary.Failed++
                    }
                    New-Object PSObject -Property @{
                        Package=$pkg.Id
                        RepoVersion=$pkg.Version
                        PublishedVersion=$(if($pkg.PublishedVersion -eq $null) {"Not Published"} else { $pkg.PublishedVersion })
                        TestComputerName=$_.TestComputerName
                        ResultDetails=$_.ResultDetails
                        Status=$_.Status
                    }
                }
            }
            else {
                $summary.Total++
                $summary.Skipped++
                New-Object PSObject -Property @{
                    Package=$pkg.Id
                    RepoVersion=$pkg.Version
                    PublishedVersion=$(if($pkg.PublishedVersion -eq $null) {"Not Published"} else { $pkg.PublishedVersion })
                    TestComputerName=$null
                    ResultDetails=@{}
{'fraction_non_alphanumeric': 0.09818426361802286, 'fraction_numerical': 0.0016812373907195697, 'mean_word_length': 1.3393629571372394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '918555', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1366, 'n_words': 225}