Invoke simple synchronous pipeline
suggest changeGet the current date and time.
public class Program
{
static void Main()
{
// create empty pipeline
PowerShell ps = PowerShell.Create();
// add command
ps.AddCommand("Get-Date");
// run command(s)
Console.WriteLine("Date: {0}", ps.Invoke().First());
Console.ReadLine();
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents