I want to execute a powershell script from an event receiver. The event receiver is triggered whenever an new item is added to my custom list in sharepoint online site.
Whatever you do in Powershell, you should be able to convert in code behind. If you start another post on that, maybe I could help convert it. But if that is too cumbersome, try this post:
Or you could try running a process object from your receiver (something I've only tested with executables)
Process myProcess = new Process(); myProcess.StartInfo.UseShellExecute = true; myProcess.StartInfo.FileName = @"C:\Approvals.ps1"; myProcess.StartInfo.CreateNoWindow = true; myProcess.Start();