NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Data Protection

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

mheimberg
3,459 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
3,459 Views

Did you try:

powershell.exe -command "  my code here "

You need the -command parameter.

mheimberg
3,459 Views

Thanks for the input.

I will try it.

Markus

Public