I try to launch ps1 with parameter files from a c# program. But before this, I try to do it smaller, and run a "ls ." but it don't work, and I think that my code is OK.
pipeline.Commands.Add("ls ."); //in future here path of .ps1 file + arguments
Collection<PSObject> results;
// Execute PowerShell script
results = pipeline.Invoke();
//print it in a textbox
AppendLine(results.ToString());
I use like a reference Execute PowerShell Script from C# with Commandline Arguments
the error is "System.Management.Automation.CommandNotFoundException: 'ls .' is not a cmdlet, function or bat file.