This is my code working in powershell, but to put it in C# I must replace "$string" to "$string2"; but it's not working (: it must be "$string" to work... I tried '$string' and ($string) and a lot but just this "$string" working. Help ?
Powershell Code Working 100% :
$string2 = C:/Users/Sycho/Desktop/youtube-dl.exe -F https://youtu.be/f1A7SdVTlok | Out-String -stream | Select-String 133 ; "$string2".SubString(105)
var mainForm = Application.OpenForms.OfType<Form1>().Single();
string urlBoxText3 = mainForm.Controls["URL_BOX"].Text;
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();
string output = process6.StandardOutput.ReadToEnd();
label4.Text = output;