Passer deux arguments pour Powershell en C#
Bonjour,
J'aimerais passer deux arguments pour mon script Powershell mais actuellement je n'arrive qu'a en envoyer qu'un seul quelqu'un aurait la solution ?
Code:
1 2 3 4 5 6 7 8
| var ps1File = @"C:\Temp\2.ps1";
var startInfo = new ProcessStartInfo(@"path\to\Powershell.exe", @"""2.ps1""")
{
FileName = "powershell.exe",
Arguments = $"-NoProfile -ExecutionPolicy unrestricted -file \"{ps1File}\"{" 10"}\"",
UseShellExecute = false
};
Process.Start(startInfo); |
Voici mon code.