The Sys Admin guy is writing some common housekeeping Power Shell scripts. Predominantly for AD management (updating exchange details, moving people around security groups etc.)
I'd like to use these scripts from C# (I intend to write it as a library, consumed by a web site).
I've seen this code project article which looks interesting and a good place to start.
Does anyone have any experience of Power Shell interop? Can anyone think of any major gotchas before I jump head first into a spike?
Extra Information:
I appreciate there are logistical challenges particularly with CI and versioning.
The plan was initially to use Directory Services, exposing services through a web API and CmdLets. Unfortunately we’re having difficulties with Directory Services (e.g. truncated results for large sets).
In the meanwhile, rather than use an inconsistent mix, I figured I should investigate using the Sys Admins’ scripts. Why re-invent the wheel?
I’ve already written my domain model. I intend to implement the repository pattern so I can abstract out AD / Exchange integration allowing different implementations in the future.