When executing a remote action from the App or automatically through a policy, you might want to hand over dynamic information either by manually providing these or through dynamic content. To do that you will first have to set up a Task Scheduler task to actually be able to forward parameters. For details on how to set up a remote action please check the according acticle from this KB.
Make sure to actually use the correct powershell version:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
And provide the below arguments:
-ExecutionPolicy Bypass -File "C:\<filepath>\<filename>.ps1" -param1 "$(Arg0)" -param2 "$(Arg1)"
If you want to pass through more than 2 parameters you will just have to provide additional parameters in the previously shown format.
Below you can find a sample script illustrating the usesage of these parameters
param( $Param1, $Param2 )
$body = ConvertTo-Json @{ channel = "#ea_alerts" text = "Solarwinds reported a '$Param1' issue. Details: '$Param2'" username = "Enterprise Alert" }
$uriSlack = "<REST_Endpoint>"
Invoke-RestMethod -Method POST -ContentType "application/json" -body "$body" -Uri "$uriSlack"}