Data Backup and Recovery

Invoke Powershell-script in SnapManager "run command after operation"

mheimberg
2,699 Views

Hi all

I intend to run a little Powershell script after the Snapmanager job - like we all know, there is that checkbox "run command after operation" to call an external program or script.


But pointing to my script triggers no action.

At a second look, this is not surprising much: also when calling it from a DOS-box the syntax is "powershell <path-to-script>".

So I tried pointing to the powershell.exe in %systempath%\windowspowershell\v1.0\ and specify the path to my script as parameter.

But adding the parameter in the line "Specify full path to the program...." together with the powershell.exe-path generates an error "invalid location".

Adding the parameter into the field "Command arguments" results in the error "Invalid command arguments: Unable to find the matched SnapManager variables."

So: anyone got an idea how to invoke a powershell-script in a SnapManager job?

THX

Markus

2 REPLIES 2

bsti
2,699 Views

Did you try:

powershell.exe -command "  my code here "

You need the -command parameter.

mheimberg
2,699 Views

Thanks for the input.

I will try it.

Markus

Public