So it should do what i basically described. The issue is restic shows only text to enter password “enter password for repository:” and when i enter it, it shows nothing expect some errors that access is denied to that folders. At first i thought it is caused by --quiet flag so it wouldn’t output any text but i removed that flag and it does the same thing.
I don’t know particularly much about powershell, but a pipe | probably just redirects stdout to the following command, which appears to just store the output in a file, but does not print it on the terminal. That is the reason why the output is not visible on the terminal.
The remaining output is printed on stderr, which is not redirected with the command you’re currently using. So you’ll have to add some option to redirect stderr to stdout, maybe 2>&1 also works for Powershell, but I have no clue what the correct syntax is.
For hiding the powershell window, there are probably lots of tutorials available on the internet.
This works for me with powershell, 2> is the standard error file descriptor. The | (pipe) only gets the standard output.
I do not know how to run powershell without opening up a window.
.${RESTICEXE} backup -r $RESTIC_REPOSITORY --iexclude-file $RESTIC_IEXCLUDE_FILE --use-fs-snapshot --verbose --verbose --cache-dir $CACHEDIR --json ${RESTIC_SOURCE_DRIVE}:\ –compression $RESTIC_COMPRESSION_LEVEL 2>$RESTIC_STDERR_FILE | Out-File -FilePath .\restic_temp_stdout.log -encoding ascii
Note the use of --use-fs-snapshot
Of course, the variables have to be set before the command is run.
Hope this helps.