Transfering the powershell output

Hello All,

How can i transfer powershell output from first step to second step?

I Want to transfer some variables between steps but i don’t know how can i do it

Best Regards

Mutlu

Put the output into a file and have the next step read that file. Or maybe set a client property?

1 Like

Thank you for your answer but i don’t know how do i get client output from master server?

Script runs on client and i can write output to text file but the text file located on the client… :frowning:

For example;

I want to run first script on the host A. And then i need to capture script output from host A and finally i will transfer the output to host B with the second script.

Run script on host A > get output from master bigfix server > run the second script with host A output on host B

Many thanks

Can you use the REST API to implement this?

To be clear, I’m referring to using REST API to execute a custom action targeting Host B using the output from Host A’s initial action?

I dump the output into a custom registry entry then have analysis grab it.

It looks like you are trying to do automation across devices. You may want to have a look at the Server Automation features (included in Lifecycle) and see if that helps with your use case.

Rosario.

Hello Rosario,

Yes, we want to use Server Automation but i don’t how can i transfer the data/variable from one step to another step.

I have two script. The first script runs on host A and return only “1” or “0” value, if it is possible; I want to continue to second script if return value is “1” ( for example )

if it is possible, can you share me the screenshot or simple detailed scenario? Because i am newbie on bigfix.

Many thanks to all

Best Regards

If you can make the return of the script act as a return code then it should be relatively easy.
Create a plan and condition the second step on the failure/success of the first step. I made a very simple one to show you how to set the parameters in the picture. With the setting as per the screenshot the second step will run only on devices where the first step succeeded.

Rosario.

But I used “1” or “0” values only for explaining to you.

Normally, the first script will return array or specific values ( disk id, uptime value, date etc. or disk numbers etc. ) and we want to transfer the custom values to second script.

I don’t believe we have anything out-of-the-box to do something like that, but you coukd potentially write an application or wrapper using the REST API. The first action would need to create some output retrieved by an Analysis, and those results could be used as an action parameter when you create the second action. Just a thought.

@mutluozel I see now. Nope, there’s nothing like that available out of the box. One option is what JasonWalker mentioned above. Others may include the use of a shared repository that all the agents have access to so you can do what you need without having to go all the way back to the server.

Rosario.

1 Like

Many thanks, rest api it will needs to good effort. I will try to shared repository.

Thank you to all

Best Regards

Mutlu

Ohhhh, I thought you had a baseline and need to keep values between each action.

You need to transfer that output to the other server… welp… options I can think of.

  • Output the file and scp it to the other server with keys (Linux)
  • set up some sort of machine trust to sent the file over to a share of the other server (windows)
  • set a client property on machine 1 from the output of your command, then on machine 2, use an API call to the root to get the property value of machine 1.