Invoke simple synchronous pipeline C# with Example



Invoke simple synchronous pipeline C# with Example

Get 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(); 
} 
} 
 

System.DirectoryServices.Protocols.LdapC 
onnection 

0 Comment's

Comment Form

Submit Comment