Add-Type from cs, that requires referencing assemblies

Question:

I hava a cs file with very simple code:

It requires Ionic.Zip assembly. I want to add this type to my powershell like this:

When I do this it gives me:

It seems to have compiled assembly in some temp location and it can’t find Ionic.Zip there.

It works, however, if specify the output assembly and then add this assembly:

So I’m wondering if there’s a way to avoid usage of output assembly?

Answer:

In Powershell v3 CTP1 you can resolve the full path (fullname) of your zip library and reference that:

Source:

Add-Type from cs, that requires referencing assemblies by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply