Get command arguments in Powershell scripts
cancel
Showing results for 
Search instead for 
Did you mean: 

Get command arguments in Powershell scripts

L2 Linker

Hi all

 

I'm trying to get Command-Arguments in a self-made script in Powershell.

 

On Python it is:
demisto.args().get('<command-argument>')

 

What is it in Powershell? Because I tried it with:
$demisto.Args()["<command-argument>"]

But this didn't worked on my self-made script. 

 

(Cortex XSOAR Version: 6.0.2 Build: 94597)

 

Thanks

roger

 

1 ACCEPTED SOLUTION

Accepted Solutions

L1 Bithead

You can get the args passed in like this:

 

$value = $demisto.Args().value

$demisto.Results($value)

 

If you create a new automation script, and switch the type to Powershell, there is some example code provided.

View solution in original post

2 REPLIES 2

L1 Bithead

You can get the args passed in like this:

 

$value = $demisto.Args().value

$demisto.Results($value)

 

If you create a new automation script, and switch the type to Powershell, there is some example code provided.

View solution in original post

Thank you MBeauchamp

 

That helped me. My script is now runinng

 

cheers

roger

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!