Subscribe
Accepted Solution

How to use a calculated value in a command as value in Parameter

Hi Team,

 

I have written a attached workflow wherein i m creating a volume in first command, then Qtree part comes in. I dont want user to put the qtree name instead i have added a custom powershell command to get a "Qtree Name" from "DFS mgmt" because "Qtree Name" should be unique in the entire domain.

 

I am able to get a "Qtree Name" from "DFS mgmt" but i need to use that name for further commands like "CIFS share creation and further on".

 

Need help about how i can do this.?

 

So in attached WorkFlow i get a qtree name in variable "$QtreeName" but how i can pass the value of this to qtree1 to use it in further commands?

 

 

Re: How to use a calculated value in a command as value in Parameter

Others may have others ideas, but you are in a place others hit often. You need the run-time results of one command to be useable in another subsequent comamnd of the workflow. People's first thought is getting the result into an MVEL namespace variable so you can then pass it to the subsequent command step. However, that is not possible (a longer story).

 

WFA does have the ability for one command to create and set a workflow-global variable and a subsequent workflow command step can get to that variable ... using (check Developer Guide and check exact spelling of cmdlets):

    Set-WfaWorkflowParameter

    Get-WfaWorkflowParameter

 

So something like:

  • modify your 1st command to load it's result into a workflow parameter using Set-WfaWorkflowParameter, say: myQtreeName
  • modify your 2nd command to get that value using Get-WfaWorkflowParameter to get myQtreeName

 

This probably means you can't use the built-in certified commands to cretae a qtree, share, etc (anything that needs to access myQtreeName). You will need to clone them and then modify them to use Get-WfaWorkflowParameter rather than a passed input parameter.

Re: How to use a calculated value in a command as value in Parameter

Thanks Korns.