<commit_before># DownloadTestAgent.ps1 takes two parameters , sourcePath and destinationPath
# $sourcePath is the path from which the test agent is to be downloaded or copied.
# $destinationPath is the location to which the test agent will be downloaded or copied.

# Validate that the given source path exists and is not a directory.
function ValidateSourceFile([string] $sourcePath)
{
   if(! (Test-Path -Path $sourcePath))
   {
         throw "Test agent source path '{0}' is not accessible to the test machine. Please check if the file exists and that test machine has access to that machine" -f $sourcePath
   }
   if((Get-Item $sourcePath) -is [System.IO.DirectoryInfo])
   {
          throw "Please provide the source path of test agent till the installation file. Given path is {0}" -f $sourcePath
   }
}

# Create the parent directory if it does not exist
$destinationDirectory = Split-Path -Path $destinationPath -Parent
$isPresent = Test-Path $destinationDirectory
if(!$isPresent)
{
    New-Item -ItemType Directory -Path $destinationDirectory
}

# Check if the given path is a valid Uri
$isUri = [System.Uri]::IsWellFormedUriString($sourcePath, [System.UriKind]::Absolute)

# Download the test agent to desired location if source path is Uri
if($isUri)
{
   Write-Verbose -Message "Downloading test agent from $sourcePath to test machine."
   Invoke-WebRequest $sourcePath -OutFile $destinationPath
}
else
{
   / ValidateSourceFile($sourcePath)
    $sourceDirectory = Split-Path -Path $sourcePath -Parent
    $sourceFileName = Split-Path -Path $sourcePath -Leaf

    Write-Verbose -Message "Copying file from $sourcePath to test machine." -f $sourcePath
    robocopy $sourceDirectory $destinationDirectory $sourceFileName /Z /mir /NP /Copy:DAT /R:10 /W:30
    # If robo copy exits with non zero exit code then throw exception.
    $robocopyExitCode = $LASTEXITCODE 
    if($robocopyExitCode -eq 0x10)
    {
         throw "Robocopy failed to copy fail from $sourceDirectory to $destinationDirectory with a exit code $robocopyExitCode."
    }
}<commit_msg>Added Support in download test agent to specify multiple source and destination path<commit_after># DownloadTestAgent.ps1 takes two parameters , sourcePath and destinationPath
# $sourcePath is the path from which the test agent is to be downloaded or copied.
# $destinationPath is the location to which the test agent will be downloaded or copied.

# Validate that the given source path exists and is not a directory.
function ValidateSourceFile([string] $sourcePath)
{
   if(! (Test-Path -Path $sourcePath))
   {
         throw "Test agent source path '{0}' is not accessible to the test machine. Please check if the file exists and that test machine has access to that machine" -f $sourcePath
   }
   if((Get-Item $sourcePath) -is [System.IO.DirectoryInfo])
   {
          throw "Please provide the source path of test agent till the installation file. Given path is {0}" -f $sourcePath
   }
}

$source = $sourcePath.Split(";")
$counter = 0;
$destinationFile = $destinationPath.Split(";")

foreach($sourcePath in $source)
{
    Write-Verbose $sourcePath -Verbose
    # Check if the given path is a valid Uri
    $isUri = [System.Uri]::IsWellFormedUriString($sourcePath, [System.UriKind]::Absolute)

    # Download the test agent to desired location if source path is Uri
    if($isUri)
    {
        # Create the parent directory if it does not exist
        $destinationDirectory = Split-Path -Path $destinationFile[$counter] -Parent
        $isPresent = Test-Path $destinationDirectory
        if(!$isPresent)
        {
            New-Item -ItemType Directory -Path $destinationDirectory
        }

        Write-Verbose -Message "Downloading test agent from $sourcePath to test machine."
        Invoke-WebRequest $sourcePath -OutFile $destinationFile[$counter]
        $counter++
    }
    else
    {
        ValidateSourceFile($sourcePath)
        $sourceDirectory = Split-Path -Path $sourcePath -Parent
        $sourceFileName = Split-Path -Path $sourcePath -Leaf

        Write-Verbose -Message "Copying file from $sourcePath to test machine." -f $sourcePath
	robocopy $sourceDirectory $destinationDirectory $sourceFileName /Z /mir /NP /Copy:DAT /R:10 /W:30
	# If robo copy exits with non zero exit code then throw exception.
	$robocopyExitCode = $LASTEXITCODE 
	if($robocopyExitCode -eq 0x10)
	{
	   throw "Robocopy failed to copy fail from $sourceDirectory to $destinationDirectory with a exit code $robocopyExitCode."
	}
    }
}
{'fraction_non_alphanumeric': 0.0834072759538598, 'fraction_numerical': 0.004658385093167702, 'mean_word_length': 3.6580578512396693, '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': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2491941', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1231, 'n_words': 497}