<commit_before>param (
    [string]$environmentName,
    [string]$resourceFilteringMethod,
    [string]$machineNames,
    [string]$applicationPoolName,
    [string]$dotNetVersion,
    [string]$pipeLineMode,
    [string]$identity,
    [string]$username,
    [string]$password,
    [string]$additionalArguments,
    [string]$configureAppPoolInParallel
    )

Write-Verbose "Entering script IISAppPoolConfigure.ps1" -Verbose
Write-Verbose "environmentName = $environmentName" -Verbose
Write-Verbose "resourceFilteringMethod = $resourceFilteringMethod" -Verbose
Write-Verbose "machineNames = $machineNames" -Verbose
Write-Verbose "applicationPoolName = $applicationPoolName" -Verbose
Write-Verbose "dotNetVersion = $dotNetVersion" -Verbose
Write-Verbose "pipeLineMode = $pipeLineMode" -Verbose
Write-Verbose "identity = $identity" -Verbose
Write-Verbose "additionalArguments = $additionalArguments" -Verbose
Write-Verbose "configureAppPoolInParallel = $configureAppPoolInParallel" -Verbose


import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal"
import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common"
import-module "Microsoft.TeamFoundation.DistributedTask.Task.DevTestLabs"
Import-Module "Microsoft.TeamFoundation.DistributedTask.Task.Deployment.Internal"
Import-Module "Microsoft.TeamFoundation.DistributedTask.Task.Deployment.RemoteDeployment"

#Triming Application pool name, username , password and additional arguments
$applicationPoolName = $applicationPoolName.Trim()
$username = $username.Trim()
$password =$password.Trim()
$additionalArguments = $additionalArguments.Trim()
$additionalArguments = $additionalArguments.Replace("`"","'")

$iisAppPoolConfigBlock = Get-Content ./IisAppPoolConfigOnTargetMachine.ps1 | Out-String
$ScriptArguments =  "-applicationPoolName `"$applicationPoolName`" -dotNetVersion `"$dotNetVersion`" -pipeLineMode $pipeLineMode -identity $identity -username `"$username`" -password `"$password`" -additionalArguments `"$additionalArguments`""

Write-Output (Get-LocalizedString -Key "Starting configuring IIS application pool with name : {0}" -ArgumentList  $applicationPoolName)
if($resourceFilteringMethod -eq "tags")
{
    Invoke-RemoteDeployment -environmentName $environmentName -tags $machineFilter -scriptBlock $iisAppPoolConfigBlock -scriptArguments $ScriptArguments -runPowershellInParallel $deployInParallel
}
else
{
    Invoke-RemoteDeployment -environmentName $environmentName -machineNames $machineFilter -scriptBlock $iisAppPoolConfigBlock -scriptArguments $ScriptArguments  -runPowershellInParallel $deployInParallel
}
Write-Output (Get-LocalizedString -Key "Successfully configured IIS application pool with name : {0}" -ArgumentList  $applicationPoolName)<commit_msg>Resloving parameter name change in  Invoke-RemoteDeployment   method<commit_after>param (
    [string]$environmentName,
    [string]$resourceFilteringMethod,
    [string]$machineNames,
    [string]$applicationPoolName,
    [string]$dotNetVersion,
    [string]$pipeLineMode,
    [string]$identity,
    [string]$username,
    [string]$password,
    [string]$additionalArguments,
    [string]$configureAppPoolInParallel
    )

Write-Verbose "Entering script IISAppPoolConfigure.ps1" -Verbose
Write-Verbose "environmentName = $environmentName" -Verbose
Write-Verbose "resourceFilteringMethod = $resourceFilteringMethod" -Verbose
Write-Verbose "machineNames = $machineNames" -Verbose
Write-Verbose "applicationPoolName = $applicationPoolName" -Verbose
Write-Verbose "dotNetVersion = $dotNetVersion" -Verbose
Write-Verbose "pipeLineMode = $pipeLineMode" -Verbose
Write-Verbose "identity = $identity" -Verbose
Write-Verbose "additionalArguments = $additionalArguments" -Verbose
Write-Verbose "configureAppPoolInParallel = $configureAppPoolInParallel" -Verbose


import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal"
import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common"
import-module "Microsoft.TeamFoundation.DistributedTask.Task.DevTestLabs"
Import-Module "Microsoft.TeamFoundation.DistributedTask.Task.Deployment.Internal"
Import-Module "Microsoft.TeamFoundation.DistributedTask.Task.Deployment.RemoteDeployment"

#Triming Application pool name, username , password and additional arguments
$applicationPoolName = $applicationPoolName.Trim()
$username = $username.Trim()
$password =$password.Trim()
$additionalArguments = $additionalArguments.Trim()
$additionalArguments = $additionalArguments.Replace("`"","'")

$iisAppPoolConfigBlock = Get-Content ./IisAppPoolConfigOnTargetMachine.ps1 | Out-String
$ScriptArguments =  "-applicationPoolName `"$applicationPoolName`" -dotNetVersion `"$dotNetVersion`" -pipeLineMode $pipeLineMode -identity $identity -username `"$username`" -password `"<PASSWORD>`" -additionalArguments `"$additionalArguments`""

Write-Output (Get-LocalizedString -Key "Starting configuring IIS application pool with name : {0}" -ArgumentList  $applicationPoolName)
if($resourceFilteringMethod -eq "tags")
{
    Invoke-RemoteDeployment -environmentName $environmentName -tags $machineFilter -scriptBlockContent $iisAppPoolConfigBlock -scriptArguments $ScriptArguments -runPowershellInParallel $deployInParallel
}
else
{
    Invoke-RemoteDeployment -environmentName $environmentName -machineNames $machineFilter -scriptBlockContent $iisAppPoolConfigBlock -scriptArguments $ScriptArguments  -runPowershellInParallel $deployInParallel
}
Write-Output (Get-LocalizedString -Key "Successfully configured IIS application pool with name : {0}" -ArgumentList  $applicationPoolName)
{'fraction_non_alphanumeric': 0.10352264557872035, 'fraction_numerical': 0.0014378145219266715, 'mean_word_length': 7.318385650224215, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4938370', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1550, 'n_words': 311}