How to invoke executable or powershell script from SharePoint 2010 Workflow?

Ninja Cowgirl picture Ninja Cowgirl · Aug 4, 2013 · Viewed 10.2k times · Source

I would like to invoke an executable (or Powershell script) from SharePoint 2010 workflow. What are my options? Is it even possible? I did some search online but nothing good comes out. All I get how to execute workflow from powershell script or executable but that's not what I am looking for.

Idea is to when a approver done with approving a document (doc, docx, xls, or xlsx) then I would like workflow to invoke a powershell or executable with parameters.

When I manually use the executable it looks like below from cmdlet.

C:\ConvertDocs> .\convert.exe c:\docs\test.xls c:\pdfs\test.pdf

I have a powershell with parameters that uses the same executable. And powershell script cmdlet look like below.

.\call_Convert.ps1 c:\docs\test.xls c:\pdfs\test2.pdf

Answer