Skip to content

Instantly share code, notes, and snippets.

@fearthecowboy
Created August 19, 2014 18:17
Show Gist options
  • Save fearthecowboy/249486585a393370da64 to your computer and use it in GitHub Desktop.
Save fearthecowboy/249486585a393370da64 to your computer and use it in GitHub Desktop.
Dynamic PowerShell from C# using my DynamicPowerShell class
dynamic ps = new DynamicPowershell();
DynamicPowershellResult result = ps.Dir(@"c:\") ;
DynamicPowershellResult result2 = ps.TestPath(result);
foreach (var r in result2) {
Console.WriteLine(r); // prints true for each item!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment