Hi @sanjubaba,
I think that you're speaking of using a Powershell script for data input.
Anyway, you can use a scripted input (for more infos see at https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptedInputsIntro ).
In addition, you could see the Splunk_TA_Windows that uses many PS scripts (https://splunkbase.splunk.com/app/742/).
In few words, you can use the PS script in two ways:
Second choice is better because you can manage it all in Splunk.
Ciao.
Giuseppe