To more easily integrate restic with automatic VSS creation I wrote a Windows PowerShell script that can be run to automate this without the complications mentioned above. It is available in the attached zip:
restic-backup-windows-vss.zip
If restic has a repository for external scripts but perhaps it could be included there.
The meat of the script is in these lines excerpted from the script (omitting the config part):
$ShadowPath = $rootVolume + 'shadowcopy\'
$s1 = (Get-WmiObject -List Win32_ShadowCopy).Create($rootVolume, "ClientAccessible")
$s2 = Get-WmiObject Win32ShadowCopy | Where-Object { $.ID -eq $s1.ShadowID }
$device = $s2.DeviceObject + "\"
cmd /c mklink /d $ShadowPath "$device"
ForEach ($folderToBackup in $foldersToBackup) {
cmd /c $resticExe backup -r $resticRepository ($ShadowPath + $folderToBackup)
}
$s2.Delete()
cmd /c rmdir $ShadowPath