Powershell script Pre/Post commands not working!
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 =/
Acronis True Image
Please see the document attached that I have used to successfully run powershell commands.
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.
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:
Working directory: C:/Windows/System32/WindowsPowerShell/v1.0
Arguments: -ExecutionPolicy ByPass -File //<server>/<share>/<pathtopsfile>.ps1
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.