Getting Data In

Why are certain Powershell scripts running and others not?

damo66a
Explorer

I'm trying to get data in from a server via a powershell script. I have another app already doing similar on the same server but for some reason (that is driving me up the wall) i constantly get the error:

 

 

ERROR Executing script=. "$SplunkHome\etc\apps\vmwareinventory\appserver\static\vmguests.ps1" for stanza=VMWare-Guests failed with exception=The system cannot find the path specified.

 

I have checked and double checked the spellings, the system variables (for Splunk_Home), renamed the files, the directories and still it comes up with this error. I have followed the instructions to the letter from the Splunk Documentation and still the error persists.

 

This is my input stanza:

 

[powershell://VMWare-Guests]
script = . "$SplunkHome\etc\apps\vmwareinventory\appserver\static\vmguests.ps1"
schedule = 30 0 * * *
sourcetype = vm:inventory
index = vmware
disabled = false

 

 

Can someone please tell me why this would be happening with this script but not others on the same server?

 

TIA

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

the variables is "$SPUNK_HOME" and not "$SplunkHome", please try using the correct variables or the absolute path.

Ciao.

Giuseppe

0 Karma

damo66a
Explorer

Hi @gcusello 

 

Thanks for your input. In terms of correct variables, this is what is in the instructions on the Splunk Documentation located here

I will try what you say but I have simply followed the instructions.

 

D

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

I'm not a PowerShell expert, but let me know if you solved changing the variable.

Ciao.

Giuseppe

0 Karma

damo66a
Explorer

so i changed the variable and it made no difference. we're still getting the same "cannot find file specified" error. 

 

we do have other scripts running on this server by Splunk so its somewhat confusing. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

have you seen the Splunk TA Windows (https://splunkbase.splunk.com/app/742)?

then in splunkbase there's this app that I never used Hurricane Labs Add-on for Windows PowerShell Transcript (https://splunkbase.splunk.com/app/4984) that maybe can help you.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...