You can create a search alert, setup the conditions, and the schedule.
Then in the actions options specify "trigger a shell script" to call.
see the documentation on how to pass arguments to the script :
For powershell, you may need to change the system policy settings to allow splunk to unsigned scripts run it.
I am looking for a way to run PS script directly from alert actions. I couldn't find a way to do it except running a bat script to call my powershell script. If anybody find a way to resolve this, please share 🙂