Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Whats the main difference between Add-Type and [Reflection.Assembly]::LoadFrom($DLL.FullName) for example

$
0
0

Hello

I have a query please, if someone can help answer it

I am just not clear on when to use which method and if they need to be used together some of the time or all of the time.

Is it true to say the answer to the above is you use Add-Type when the DLL containing the type has already been loaded into memory but not yet scope of the script (e.g. like the 'using' statement in C#)

if the DLL or its manifest is not in memory then you need to firs to load into memory via [Reflection.Assembly]::LoadFrom($DLL.FullName)  for example?

But if that is the case do you not then need to use Add-Type once LoadFrom has loaded into memory to get the members of the type?

Thank you

AAnotherUser__


AAnotherUser__


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>