Runspace objRunspace = null; objRunspace = RunspaceFactory.CreateRunspace(); objRunspace.Open(); PowerShell powershell = PowerShell.Create(); powershell.Runspace = objRunspace; powershell.AddScript("my powershell script"); Collection<PSObject> objPS1 = powershell.Invoke(); if (objPS1.Count == 0) { //I Assumes that the PC is down }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)