2021年3月9日星期二

Generic methodology for dealing with loading .dll files

I'm looking to (potentially) use a .dll in a script to extend the script's functionality. But getting doco on what's in the .dll is difficult (I've seen blogs that suggest what I want might be possible). But then I got side tracked, and started to think how to do this generically?

How do you learn what's available to the PowerSheller in a .dll.

So I know I can load the .dll using Add-Type, and I think I can use [appdomain]::CurrentDomain.GetAssemblies() (learnt of that just today) with a | select ExportedTypes, and I think from there I can do [custom.type] | gm to find the methods, but from there I get a little unstuck. How do I find the overloads for a given method?

Have I even got my initial steps correct? I notice the location property from the [appdomain] output doesn't match the .dll exactly. (The .dll might be in Program Files, but [appdomain] finds one in C:\windows\Microsoft.net\assembly - or is that just where it gets copied to?)

https://stackoverflow.com/questions/66556785/generic-methodology-for-dealing-with-loading-dll-files March 10, 2021 at 08:41AM

没有评论:

发表评论