# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$($Display.Bounds.Width)" -FilePath "$InstallDirectory\System\XIII.ini"
Write-ReplaceContentInFile -Pattern '^FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$($Display.Bounds.Height)" -FilePath "$InstallDirectory\System\XIII.ini"
# Might need to set FOV
# if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9))
$NewPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
New-Item -ItemType Directory -Force -Path "$InstallDirectory\Save"
Copy-Item -Path "$InstallDirectory\Default.pro" -Destination "$InstallDirectory\Save\$NewPlayerAlias.pro"