$NewName = $args[0]
$InstallDir = $PSScriptRoot
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
$content = (Get-Content $FilePath) -replace $Regex, $Replacement
[IO.File]::WriteAllLines($FilePath, $content)
}
Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\main\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\mainta\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\maintt\configs\unnamedsoldier.cfg"