Are you trying to execute the script remotely or on the server where Splunk resides itself? For executing a script on the server where Splunk resides based off the results of a search, you can create your custom alert action or a custom command, which will accept the output of the search, parse through the results and invoke the required PS script. "Run a script" alert action has officially been deprecated. You can still try and use it, but in the future releases of Splunk, it will be removed. May not even function as you expect. To execute a script remotely, you are again dependent on a custom alert action or a custom command to invoke a script, which can connect with your remote server and run the PS script on it or perform the operations as per your requirements. ++If this helps, please consider accepting as an answer++
... View more