$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)
}
Copy-Item -Path "$InstallDir\Content\System\Profiles\Default.ini" -Destination "$InstallDir\Content\System\Profiles\PlayerProfile1.ini"
Write-ReplaceContentInFile -Regex '^Name=(.+)' -Replacement "Name=$NewName`r`nPlayerName=$NewName" -FilePath "$InstallDir\Content\System\Profiles\PlayerProfile1.ini"