I wrote several utilities that use PowerShell cmdlets for App-V. An interesting part of Microsoft seems to only document cmdlets, not the .net collections used behind Powershell modules.
I am now familiar with P / Invoke and COM Interop, and I learned how to use System.Management.Automation to create a powershell session and call cmdlets.
But something doesnβt smell to me. I mostly write my own wrapper classes to hide powershell calls from the rest of my code. It seems that I should either a) bypass powershell and go directly to the managed library behind it, or b) there should be a better mechanism for creating interop libraries for powershell cmdlets.
Microsoft seems to be using PS CmdLets a lot these days, which is essentially becoming the new API to interact with.
Am I missing something? What is a good strategy to use in this scenario?
Christopher painter
source share