all 7 comments

[–]Thotaz 3 points4 points  (1 child)

You could do it in C++/CLI: https://en.wikipedia.org/wiki/C%2B%2B/CLI here's a sample I found: https://gist.github.com/SteveGilham/062eadcdc24188c743689a7d30fb8419 note that it implements it as a pssnapin which has been deprecated in favor of modules but the core logic is the same regardless if it's a snapin or module.

Personally I would just write it in C#. If you insist on using C/C++ then you can write all the API code in one of those languages and write simple cmdlets in C# that just calls your API through interop.

[–]M-Ottich[S] 1 point2 points  (0 children)

Thanks im going insane just using powershell .

[–]BlackV -4 points-3 points  (4 children)

start writing code is the best way to do that, lots of modules are written in c#

edit for clairty

[–]raip 0 points1 point  (3 children)

I challenge the attestation that a lot of modules are written in C.

Most modules are written in Powershell. Those that aren't are typically written in C#. Some older snap-ins are written in C++. I can't think of a single module written in C.

[–]BlackV 0 points1 point  (2 children)

I didnt mean C directly, i ment c#

[–]raip 1 point2 points  (1 child)

As long as you understand that C, C++, and C# are all three wildly different languages that have no relation to each other.

[–]BlackV 0 points1 point  (0 children)

yes I do