$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 '\$PCFG::Name = (.+)' -Replacement "`$PCFG::Name = ""$NewName"";" -FilePath "$InstallDir\config\Players.cs"
Write-ReplaceContentInFile -Regex '\$PCFG::Name0 = (.+)' -Replacement "`$PCFG::Name0 = ""$NewName"";" -FilePath "$InstallDir\config\Players.cs"
Write-ReplaceContentInFile -Regex '\$PCFG::RealName = (.+)' -Replacement "`$PCFG::RealName = ""$NewName"";" -FilePath "$InstallDir\config\Players.cs"
Write-ReplaceContentInFile -Regex '\$PCFG::RealName0 = (.+)' -Replacement "`$PCFG::RealName0 = ""$NewName"";" -FilePath "$InstallDir\config\Players.cs"