Question

I'm developing some PowerShell Cmdlets that are dependent on third party libraries from Google. On my machine I'm able to compile the cmdlets in to a .dll file and everything works, but when I try loading it on a secondary machine I get errors about not finding assembly after I have run import-module on my dll file.

How can I package my cmdlets in a dll file so that someone on another machine can install the dependencies, then drop my dll file somewhere, load it up and have it work?

Was it helpful?

Solution

You will need to redistribute the third party library assemblies that you depend upon. If you xcopy deploy your module, you should just be able to put those assemblies in the same directory as your cmdlet assembly. When you do an Import-Module on your module, those assemblies should load automatically with your assembly. You should consider creating a PSD1 file for your module.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top