<commit_before>﻿param(
    [boolean]$configureWss = $false,
    [boolean]$useWss = $false,
    [boolean]$useReporting = $false,
    [boolean]$useSqlAlwaysOn = $false,
    [boolean]$IsServiceAccountBuiltIn = $false,
    [string]$sqlInstance = ${Env:\COMPUTERNAME},
    [string]$urlHostName = ${Env:\COMPUTERNAME},
	[string]$setupAccountName ="contoso\tfssetup",
	[string]$setupAccountPassword ="<PASSWORD>",
    [string]$serviceAccountName = "NT Authority\Network Service",
	[string]$serviceAccountPassword= "<PASSWORD>"
)

$setupPassword = ConvertTo-SecureString -String $setupAccountPassword -AsPlainText -Force
$setupCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($setupAccountName,$setupPassword)

$servicePassword = ConvertTo-SecureString -String $serviceAccountPassword -AsPlainText -Force
$serviceCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($serviceAccountName,$servicePassword)

Enable-PSRemoting -Force -SkipNetworkProfileCheck
Enable-WSManCredSSP -Role Server -Force
Enable-WSManCredSSP -Role Client -DelegateComputer "localhost" -Force

$adminCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ("contoso\hrboyceiii",$servicePassword)

Invoke-Command -ComputerName "localhost" -Authentication Kerberos -ScriptBlock {

	net localgroup "Administrators" "$using:setupAccountName" /add

    New-ADUser -UserPrincipalName $using:serviceAccountName -AccountPassword $using:servicePassword -Enabled $true -Name "tfsservice"

} -Verbose -Credential $adminCred

Invoke-Command -ComputerName "localhost" -Authentication Kerberos -ScriptBlock {
	Set-Location -Path (Get-Content Env:\ProgramFiles)
	Set-Location -Path "Microsoft Team Foundation Server 12.0\Tools"

	& ".\tfsconfig.exe" unattend /configure /type:standard /inputs:"UseWss=$using:useWss;UseReporting=$using:useReporting;ConfigureWss=$false;SqlInstance=$using:sqlInstance;UseSqlAlwaysOn=$using:useSqlAlwaysOn;IsServiceAccountBuiltIn=$using:isServiceAccountBuiltIn;ServiceAccountName=$using:serviceAccountName;ServiceAccountPassword=$(($using:serviceCred).GetNetworkCredential().Password)"  /verify 2>&1 | Write-Verbose
	& ".\tfsconfig.exe" unattend /configure /type:standard /inputs:"UseWss=$using:useWss;UseReporting=$using:useReporting;ConfigureWss=$false;SqlInstance=$using:sqlInstance;UseSqlAlwaysOn=$using:useSqlAlwaysOn;IsServiceAccountBuiltIn=$using:isServiceAccountBuiltIn;ServiceAccountName=$using:serviceAccountName;ServiceAccountPassword=$(($using:serviceCred).GetNetworkCredential().Password)"  2>&1 | Write-Verbose<commit_msg>switching to computer name for domain/kerberos authn<commit_after>﻿param(
    [boolean]$configureWss = $false,
    [boolean]$useWss = $false,
    [boolean]$useReporting = $false,
    [boolean]$useSqlAlwaysOn = $false,
    [boolean]$IsServiceAccountBuiltIn = $false,
    [string]$sqlInstance = ${Env:\COMPUTERNAME},
    [string]$urlHostName = ${Env:\COMPUTERNAME},
	[string]$setupAccountName ="contoso\tfssetup",
	[string]$setupAccountPassword ="<PASSWORD>",
    [string]$serviceAccountName = "NT Authority\Network Service",
	[string]$serviceAccountPassword= "<PASSWORD>"
)

$setupPassword = ConvertTo-SecureString -String $setupAccountPassword -AsPlainText -Force
$setupCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($setupAccountName,$setupPassword)

$servicePassword = ConvertTo-SecureString -String $serviceAccountPassword -AsPlainText -Force
$serviceCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($serviceAccountName,$servicePassword)

Enable-PSRemoting -Force -SkipNetworkProfileCheck
Enable-WSManCredSSP -Role Server -Force
Enable-WSManCredSSP -Role Client -DelegateComputer "$env:COMPUTERNAME" -Force

$adminCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ("contoso\hrboyceiii",$servicePassword)

Invoke-Command -ComputerName "$env:COMPUTERNAME" -Authentication Kerberos -ScriptBlock {

	net localgroup "Administrators" "$using:setupAccountName" /add

    New-ADUser -UserPrincipalName $using:serviceAccountName -AccountPassword $using:servicePassword -Enabled $true -Name "tfsservice"

} -Verbose -Credential $adminCred

Invoke-Command -ComputerName "$env:COMPUTERNAME" -Authentication Kerberos -ScriptBlock {
	Set-Location -Path (Get-Content Env:\ProgramFiles)
	Set-Location -Path "Microsoft Team Foundation Server 12.0\Tools"

	& ".\tfsconfig.exe" unattend /configure /type:standard /inputs:"UseWss=$using:useWss;UseReporting=$using:useReporting;ConfigureWss=$false;SqlInstance=$using:sqlInstance;UseSqlAlwaysOn=$using:useSqlAlwaysOn;IsServiceAccountBuiltIn=$using:isServiceAccountBuiltIn;ServiceAccountName=$using:serviceAccountName;ServiceAccountPassword=$(($using:serviceCred).GetNetworkCredential().Password)"  /verify 2>&1 | Write-Verbose
	& ".\tfsconfig.exe" unattend /configure /type:standard /inputs:"UseWss=$using:useWss;UseReporting=$using:useReporting;ConfigureWss=$false;SqlInstance=$using:sqlInstance;UseSqlAlwaysOn=$using:useSqlAlwaysOn;IsServiceAccountBuiltIn=$using:isServiceAccountBuiltIn;ServiceAccountName=$using:serviceAccountName;ServiceAccountPassword=$(($using:serviceCred).GetNetworkCredential().Password)"  2>&1 | Write-Verbose
{'fraction_non_alphanumeric': 0.12204351939451277, 'fraction_numerical': 0.0026490066225165563, 'mean_word_length': 8.209059233449477, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4437787', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1527, 'n_words': 251}