Add environment variable to set version of powershell module on Windows platform
Is your feature request related to a problem? Please describe.
I had an issues with Backrest running on Windows Server 2016. Problem related to the fact that I was unable to run Hook Command (.bat script, tested with other types of scripts like .cmd as well) on that version of Windows. Content of script was completely ignored. And on Windows 10 exactly the same setup worked just fine.
Describe the solution you'd like
I was able to find solution (workaround) for mentioned above problem, but it required rebuilding of Backrest software and making changes in command.go source file (replacing "powershell" by "pwsh", name for newer version of PowerShell 7.5 that had to be installed and added to $PATH environment variable). By making these changes problem was solved - but it would be much easier if option (such as an environment variable) exist in Backrest that would allow to overwrite default value for powershell (i.e. to set different version)
Additional context
Implementation should be quite straightforward - software should check if such environment variable set and if so - then use module name as defined in that environment variable. If it is not set - then default value should be used.
Backrest allows overriding the process used to execute scripts by specifying a custom executable. The syntax for this is #! /bin/bash as the first line of your script e.g. to use the bash shell on linux. Would #! <your windows executable> work in your case?