Advertisement
zyphaz

Star Wars: Squadrons - Toggle HDR

Feb 11th, 2023 (edited)
1,478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # How-To found here https://www.youtube.com/watch?v=YOiiJvD1-jM
  2.  
  3. Clear-Host
  4. Write-Host "
  5. .-.__      \ .-.  ___  __
  6. |_|  '--.-.-(   \/\;;\_\.-._______.-.
  7. (-)___     \ \ .-\ \;;\(   \       \ \
  8. Y    '---._\_((Q)) \;;\\ .-\     __(_)
  9. I           __'-' / .--.((Q))---'    \,
  10. I     ___.-:    \|  |   \'-'_          \
  11. A  .-'      \ .-.\   \   \ \ '--.__     '\
  12. |  |____.----((Q))\   \__|--\_      \     '
  13.    ( )        '-'  \_  :  \-' '--.___\
  14.     Y                \  \  \       \(_)
  15.     I                 \  \  \         \,
  16.     I                  \  \  \          \
  17.     A                   \  \  \          '\
  18.     |                    \  \__|           '
  19.                           \_:.  \
  20.                             \ \  \
  21.                              \ \  \
  22.                               \_\_|
  23. / \----------------------------,
  24. \_,|                           |
  25.    |    Set SWS HDR pew pew!   |
  26.    |  ,--------------------------
  27.    \_/_________________________/
  28. "
  29. # Define the file path
  30. $filePath = "$env:USERPROFILE\Documents\STAR WARS Squadrons Steam\settings\ProfileOptions_Profile"
  31.  
  32. # Define the backup directory path
  33. $backupPath = "$env:USERPROFILE\Documents\STAR WARS Squadrons Steam\settings\backup"
  34.  
  35. # Prompt the user to specify if they want HDR
  36. $hdrOption = Read-Host -Prompt "Do you want HDR enabled (yes/no)?"
  37.  
  38. # Determine the value to set based on the user's answer
  39. if ($hdrOption -eq "yes" -or $hdrOption -eq "Y") {
  40.   $hdrValue = 1
  41. }
  42. else {
  43.   $hdrValue = 0
  44. }
  45.  
  46. # Check if the backup directory exists
  47. if (!(Test-Path -Path $backupPath)) {
  48.   # Create the backup directory if it doesn't exist
  49.   New-Item -ItemType Directory -Path $backupPath
  50. }
  51.  
  52. # Make a backup of the original file
  53. Copy-Item -Path $filePath -Destination "$backupPath\ProfileOptions_Profile_$(Get-Date -Format yyyyMMdd_HHmmss)"
  54.  
  55. # Read the contents of the file into a variable
  56. $fileContents = Get-Content -Path $filePath
  57.  
  58. # Replace the line containing GstRender.HdrEnable
  59. $fileContents = $fileContents -replace '^GstRender.HdrEnable.*$', "GstRender.HdrEnable $hdrValue"
  60.  
  61. # Write the updated contents back to the file
  62. Set-Content -Path $filePath -Value $fileContents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement