3 ms·
Powershell is frankly fairly amazing. Recently I found myself needing to open the Windows datastore.edb file, and before I discovered some interops I learned th
by chris_wot 10y ago
Powershell is frankly fairly amazing. Recently I found myself needing to open the Windows datastore.edb file, and before I discovered some interops I learned that in fact you can grab a C# member definition, then use it as a signature and load that type as a Powershell object [1]
Hell, I even found a C# code snippet and was able to add into a Powershell string, then add this as a C# type definition, and Powershell compiled it to an assembly and then loaded it as an instance of a Powershell object.[2]
1. http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-walkthrough/ http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-...
2. I found how to do this here: https://blogs.technet.microsoft.com/stefan_gossner/2010/05/07/using-csharp-c-code-in-powershell-scripts/ https://blogs.technet.microsoft.com/stefan_gossner/2010/05/0...
- teyc 10y agoTo add further - I found out PInvoke over Powershell works just as well on OS X.