0
  • How can I get the output of this code ?
  • then I will put it in label4
            ProcessStartInfo startInfo6 = new ProcessStartInfo();
            startInfo6.FileName = @"powershell.exe";
            startInfo6.Arguments = "$string2 = C:/Users/Sycho/Desktop/youtube-dl.exe -F " + urlBoxText3 + "| Out-String -stream | Select-String 133 ; \"$string2\".SubString(105)";
            startInfo6.RedirectStandardOutput = true;
            startInfo6.RedirectStandardError = true;
            startInfo6.UseShellExecute = false;
            startInfo6.CreateNoWindow = true;
            startInfo6.Verb = "runas";
            Process process6 = new Process();
            process6.StartInfo = startInfo6;
            process6.Start();
            label4.Text = "Here wanna put the invoked code";
Sycho so
  • 3
  • 1
  • 1
    Is there a particular reason you want to invoke `powershell.exe`? You can host and execute PowerShell from within your .NET application instead... – Mathias R. Jessen Feb 25 '22 at 12:27

0 Answers0