Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > var arr = new[] { 1.5,2.0 };
- arr = { 1.5, 2.0 }
- > var sum = arr.Sum();
- sum = 3.5
- private static void Main(string[] args)
- {
- // Call the PowerShell.Create() method to create an
- // empty pipeline.
- PowerShell ps = PowerShell.Create();
- // Call the PowerShell.AddScript(string) method to add
- // some PowerShell script to execute.
- ps.AddScript("$arr = 1.5,2.0"); # Execute each line read from prompt
- // Call the PowerShell.Invoke() method to run the
- // commands of the pipeline.
- foreach (PSObject result in ps.Invoke())
- {
- Console.WriteLine(result.ToString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement