$Display = Get-PrimaryDisplay
Write-ReplaceContentInFile -Pattern 'seta r_customwidth (.+)' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\BaseEF\hmconfig.cfg"
Write-ReplaceContentInFile -Pattern 'seta r_customheight (.+)' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\BaseEF\hmconfig.cfg"
Write-ReplaceContentInFile -Pattern 'seta r_mode (.+)' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\BaseEF\hmconfig.cfg"
Write-ReplaceContentInFile -Pattern 'seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\BaseEF\hmconfig.cfg"
$config = @"
// This file is loaded when Elite Force starts and saved when it exits.
// You can delete any line to restore settings to the default.
// Menu settings
seta ui_initialsetup "1"
seta name "$NewPlayerAlias"
"@
Set-Content -Path "$InstallDirectory\cmod.cfg" -Value $config