This is just a quick post about SMA. I bumped many times in this error while writing PowerShell workflows in SMA …
At line:3497 char:21 + PAT000287-RelateAppSetSR -AppSetID $AppSet -SRID $Applicatio ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cannot find the 'PAT000287-RelateAppSetSR' command. If this command is defined as a workflow, ensure it is defined before the workflow that calls it. If it is a command intended to run directly within Windows PowerShell (or is not available on this system), place it in an InlineScript: 'InlineScript { PAT000287-RelateAppSetSR }'
…and I figured out that there are many reasons for this error.
If you are nesting runbooks like this…
workflow ParentWorkflow { ChildWorkflow -Param1 "Test" #Calling child workflow }
Several reasons could lead to this problem:
- The child workflow does not exist in SMA.
- The child workflow has not been published.
- The naming of the child workflow name does not match the invoke command.
- There is a space in front of the child workflow. Just edit the line, where you call the child runbook and check in the parent runbook again.
- Before you check in the parent workflow, you must check in the child workflow. This applies only when the runbook itself did not exist before. If the child runbook was created any time before the parent workflow, this error will not happen.
I hope this will help you this quite common error to eliminate during development.