PowerShell scripts in Pre/Post commands
Hi, I have Acronis Backup&Recovery 2011 Virtual Edition.
Agent installed on Hyper-V node. I create backup plan for a virtual machine which running on that node and in PrePost command field past that commands:
Command: c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments: -File C:\lm\dbg.ps1
dbg.ps1 contents one simple command: Get-ExecutionPolicy.
When I press Check button in "Command Edit" window, dialog with progress bar are shown infinitely.
OS with acronis agent: Windows 2008 R2 Enterprise, PowerShell execution policy set to Unrestricted.

- Log in to post comments

Thank you for your reply.
In that article pre/post commands are not executed inside a virtual machine (under guest OS), but I'm trying to execute these commands on the HyperV physical host where the agent is installed.
I tried to create a simple BAT-file:
echo "234"> c:\lm\out.txt
It works perfectly.
Your command is also not working, but if I pass a nonexistent file with the PowerShell script - error are shown fine.
On attached screenshot you can see result of try to execute PowerShell script:
http://imageshack.us/photo/my-images/696/53663311.png/
Attachment | Size |
---|---|
80073-97753.png | 124.15 KB |
- Log in to post comments

It's weird, but when I specified full path c:\windows\system32\cmd.exe as you do, or 'cmd.exe' I got the same behavior as you describe - progress and an empty 'mms.exe' window. When I type just 'cmd' it works.
ps - OS used is Windows 7 32 bit.
- Log in to post comments