Getting Data In

Need help executing a script with powershell v3 Modular Input

ribicU
Engager

Could somebody help me with this problem, i have simple powershell script:

Write-Host "Num Args:" $args.Length;
foreach ($arg in $args)
{
  Write-Host "Arg: $arg";
}

and i'm trying to execute with Powershell v3 Modular Input, but i don't know how. In Command or Script Path field says put full path to a script, i did it, but it is not working.

0 Karma
1 Solution

DennisFFM
Explorer

Hi @ribicU, I think it's because your script is not returning something.
"Write-Host" is only printing to console.
Try "Write-Output" instead or save your values to a variable and "return" it in the end.

Dennis

View solution in original post

DennisFFM
Explorer

Hi @ribicU, I think it's because your script is not returning something.
"Write-Host" is only printing to console.
Try "Write-Output" instead or save your values to a variable and "return" it in the end.

Dennis

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...