kmwoley / restic-windows-backup

Powershell scripts to run Restic backups on Windows
MIT License
330 stars 68 forks source link

Fix file list passing for powershell core v7.3+ #103

Open Tamnac opened 1 month ago

Tamnac commented 1 month ago

v7.3 changed how quoted arguments are passed (see stackoverflow explanation). This change sets a var keep using the old method for compatibility.

The issue seems to revolve around line 245 where you add another set of quotes

$p = '"{0}"' -f ((Join-Path $root_path $path) -replace "\\$")

In my brief testing, even if you don't add the extra quotes, powershell v5 still works fine with paths with spaces, so I don't know what that change was for, but I'll let it stay for now.