When you run a pre-freeze/post-thaw script from a BAT file, the BAT file is stored on the Veeam Backup Server, and will be copied to a temporary location on the guest when the job runs. The Powershell script will need to be located on the guest that is being backed up and that you want the script to run on. The path for PowerShellScriptPath variable needs to be the exact path and file name on the guest.
When you are running pre or post job scripts, both the BAT file and the PowerShell script will be launched from the VeeamBackup server independent of the guest.
For error reporting you can add “>> C:\TEMP\Err_ps.txt” to the end of each action line on the PowerShell script, or “>> C:\TEMP\Err_cmd.txt” to the end of each action line in the BAT file to get error reporting output.