I was able to figure this out, the test script file contains 2 lines...
$result = Get-Process
$result
Runspace runSpace = RunspaceFactory.CreateRunspace();
runSpace.Open();
string filePath = Server.MapPath("Scripts/TestScript.txt");
StreamReader reader = File.OpenText(filePath);
string powerShellCode = reader.ReadToEnd();
reader.Close();
var shell = PowerShell.Create();
shell.Commands.AddScript(powerShellCode);
Collection<psobject> results = shell.Invoke();
DataTable tempTable = new DataTable();
tempTable.Columns.Add("Id");
tempTable.Columns.Add("Processname");
foreach (PSObject psObject in results)
{
DataRow row = tempTable.NewRow();
row["Id"] = psObject.Properties["Id"].Value.ToString();
row["Processname"] = psObject.Properties["Processname"].Value.ToString();
tempTable.Rows.Add(row);
}
GridView1.DataSource = tempTable;
GridView1.DataBind();
runSpace.Close();</psobject>