Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # How-To found here https://www.youtube.com/watch?v=YOiiJvD1-jM
- Clear-Host
- Write-Host "
- .-.__ \ .-. ___ __
- |_| '--.-.-( \/\;;\_\.-._______.-.
- (-)___ \ \ .-\ \;;\( \ \ \
- Y '---._\_((Q)) \;;\\ .-\ __(_)
- I __'-' / .--.((Q))---' \,
- I ___.-: \| | \'-'_ \
- A .-' \ .-.\ \ \ \ '--.__ '\
- | |____.----((Q))\ \__|--\_ \ '
- ( ) '-' \_ : \-' '--.___\
- Y \ \ \ \(_)
- I \ \ \ \,
- I \ \ \ \
- A \ \ \ '\
- | \ \__| '
- \_:. \
- \ \ \
- \ \ \
- \_\_|
- / \----------------------------,
- \_,| |
- | Set SWS HDR pew pew! |
- | ,--------------------------
- \_/_________________________/
- "
- # Define the file path
- $filePath = "$env:USERPROFILE\Documents\STAR WARS Squadrons Steam\settings\ProfileOptions_Profile"
- # Define the backup directory path
- $backupPath = "$env:USERPROFILE\Documents\STAR WARS Squadrons Steam\settings\backup"
- # Prompt the user to specify if they want HDR
- $hdrOption = Read-Host -Prompt "Do you want HDR enabled (yes/no)?"
- # Determine the value to set based on the user's answer
- if ($hdrOption -eq "yes" -or $hdrOption -eq "Y") {
- $hdrValue = 1
- }
- else {
- $hdrValue = 0
- }
- # Check if the backup directory exists
- if (!(Test-Path -Path $backupPath)) {
- # Create the backup directory if it doesn't exist
- New-Item -ItemType Directory -Path $backupPath
- }
- # Make a backup of the original file
- Copy-Item -Path $filePath -Destination "$backupPath\ProfileOptions_Profile_$(Get-Date -Format yyyyMMdd_HHmmss)"
- # Read the contents of the file into a variable
- $fileContents = Get-Content -Path $filePath
- # Replace the line containing GstRender.HdrEnable
- $fileContents = $fileContents -replace '^GstRender.HdrEnable.*$', "GstRender.HdrEnable $hdrValue"
- # Write the updated contents back to the file
- Set-Content -Path $filePath -Value $fileContents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement