$ProfilePath = $env:userprofile
Copy-Item -Path "$InstallDirectory\Saved Games\Nightdive Studios" -Destination "$ProfilePath\Saved Games\Nightdive Studios" -Recurse
# 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 '^seta v_width (.+)' -Substitution "seta v_width ""$($Display.Bounds.Width)""" -FilePath "$ProfilePath\Saved Games\Nightdive Studios\kexengine.cfg"
Write-ReplaceContentInFile -Pattern '^seta v_height (.+)' -Substitution "seta v_height ""$($Display.Bounds.Height)""" -FilePath "$ProfilePath\Saved Games\Nightdive Studios\kexengine.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_fov (.+)' -Substitution "seta r_fov ""100""" -FilePath "$ProfilePath\Saved Games\Nightdive Studios\kexengine.cfg"
$ProfilePath = $env:userprofile
remove-Item -Path "$ProfilePath\Saved Games\Nightdive Studios" -Recurse -force