Powershell script Pre/Post commands not working!
Hi,
Running Acronis True Image 2016 build 6571
I cannot use Powershell script no mather what exicuting policy. I still get the error message
"scriptname - cannot be load becaue running scripts is disabled on this system"
I can run scripts just fine. Signed or not. This is a problem with Acronis, please fix asap, thank you.
also, if Acronis is not setting a new variable %COMPUTER_NAME% the right one is %COMPUTERNAME% , %OPERATION_STATUS% returns nothing also =/


- Anmelden, um Kommentare verfassen zu können

Thanks but I should not have to use a batch file to launch a ps1 file
My execution policy is already set to RemoteSigned. And I've tried Unrestricted as well. Like I said, its an issue with Acronis. They don't check the current execution policy before the script is suppose to run.
BTW, Instead of that
File 2: Test.CMD with contents:
powershell -command set-executionpolicy unrestricted
powershell -file "e:\test.ps1"
powershell -command set-executionpolicy default
you can use one command,
- powershell.exe -ExecutionPolicy ByPass -File e:\test.ps1
and that way you don't have to switch policy back and forth.
- Anmelden, um Kommentare verfassen zu können

Thanks for the tip about the powershell command, I have only barely touched using it but you could try sending a PM to MVP Karl Heinz who looks to have a lot more experience in this area (based on exchanges in the private MVP forums).
- Anmelden, um Kommentare verfassen zu können

I might do that, thanks! have a good midsummer?
- Anmelden, um Kommentare verfassen zu können

I know this thread is years old, but I got here from a google search so leaving this for others...
To run PowerShell script from Acronis without a batch script (tested with 2016 build 6595 on Windows 10 1803); in the custom command dialog:
Command: powershell.exe
Working directory: C:/Windows/System32/WindowsPowerShell/v1.0
Arguments: -ExecutionPolicy ByPass -File //<server>/<share>/<pathtopsfile>.ps1
Justin
- Anmelden, um Kommentare verfassen zu können

Justin, welcome to these public User Forums.
Thank you for sharing your findings on this topic. I have found that you do not need to put the path to Powershell.exe in the Working directory box provided powershell runs Ok on your system. I have learnt about and use a lot more Powershell scripts since this topic was originally being discussed and now use this in preference to running older batch files.
- Anmelden, um Kommentare verfassen zu können