using IronPython.Hosting; using Microsoft.Scripting.Hosting; var engine = Python.CreateEngine(); var scope = engine.CreateScope(); var script = @"print('Hello World!')"; engine.Execute(script, scope);
using System.Management.Automation; var powerShell = PowerShell.Create(); powerShell.AddScript(@"Get-Process | Select-Object -First 10"); var results = powerShell.Invoke(); foreach (var psObject in results) { Console.WriteLine(psObject.Properties["ProcessName"].Value); }This example uses the PowerShell SDK to execute a script that retrieves the 10 most active processes running on the computer. In both examples, Ext DoScript method is not directly used, however, the C# code is executing external scripts in Python and PowerShell respectively, both supported through a library package.