Skip to content

Instantly share code, notes, and snippets.

@sjain882
Created April 1, 2025 16:34
Show Gist options
  • Save sjain882/0a388b2a1950988dbdc203e85a184542 to your computer and use it in GitHub Desktop.
Save sjain882/0a388b2a1950988dbdc203e85a184542 to your computer and use it in GitHub Desktop.
ReShade Repo Getter Powershell Script - Downloads & merges list of reshade repos - Useful for updating
$shaders = $PSScriptRoot + '\All Shaders\Shaders'
$textures = $PSScriptRoot + '\All Shaders\Textures'
$presets = $PSScriptRoot + '\All Shaders\Presets'
# Rename existing folder
$date = Get-Date -Format 'yyyy-MM-dd_HHmmss'
$newName = "All Shaders @ " + $date
Get-ChildItem -Directory | Where-Object { $_.Name -eq 'All Shaders' } |
ForEach-Object {
Write-Output "`n"
Write-Output "===== Renaming Existing Collection ====="
Write-Output "`n"
Rename-Item "All Shaders" -NewName $newName
}
New-Item -Name "All Shaders" -ItemType "Directory" | Out-Null
New-Item -Path "All Shaders" -Name "Shaders" -ItemType "Directory" | Out-Null
New-Item -Path "All Shaders" -Name "Presets" -ItemType "Directory" | Out-Null
New-Item -Path "All Shaders" -Name "Textures" -ItemType "Directory" | Out-Null
Write-Output "===== Cloning repos ====="
Write-Output "`n"
# Clone all repos into their own folders
foreach ($line in Get-Content .\Repos.txt) {
Write-Output "Cloning $line..."
Write-Output "`n"
git clone $line
}
Write-Output "`n"
Write-Output "===== Removing garbage ====="
Write-Output "`n"
# Remove all rubbish
Get-ChildItem -Include ".git" -Directory -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include ".github" -Directory -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include "README.md" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include ".gitignore" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include "LICENSE" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include "LICENSE.txt" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include "LICENSE.md" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include "_config.yml" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Get-ChildItem -Include ".editorconfig" -File -Recurse | ForEach-Object { Remove-Item $_.FullName -Force -Recurse }
Write-Output "===== Merging ====="
Write-Output "`n"
# Merge into folders
# Shaders
Get-ChildItem *.fx -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $shaders -Force
}
Get-ChildItem *.fxh -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $shaders -Force
}
Get-ChildItem *.cfg -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $shaders -Force
}
# Presets
Get-ChildItem *.ini -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $presets -Force
}
# Textures
Get-ChildItem *.png -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $textures -Force
}
Get-ChildItem *.cube -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $textures -Force
}
Get-ChildItem *.jpg -Exclude "*All Shaders*" -Recurse | ForEach-Object {
Move-Item -Path $_.FullName -Destination $textures -Force
}
# Remove leftovers
Write-Output "===== Removing leftovers ====="
Write-Output "`n"
Get-ChildItem -Directory -Exclude 'All Shaders' | Remove-Item -Force -Recurse
Get-ChildItem -Directory -Exclude 'All Shaders' | Remove-Item -Force -Recurse
Write-Output "===== Done ====="
Write-Output "`n"
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment