How to call a powershell script from a C code

Question:

In my case, I needed to call a powershell script from a c or c++ code source, found few links which were pretty clumsy and not good with c++, I simply want a roadmap if its possible invoking a powershell script which lists directory contents from a code snippet written in c or c++

Answer:

C++ code :

Source:

How to call a powershell script from a C code by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply