Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a Cmdlet from a DLL

Is it possible to import and invoke a Cmdlet from a DLL that is not in the PATH directories?

I want to write a build script with powershell that is able to compress the results. Therefore I found 7Zip4Powershell Cmdlets (Source), but I am unable to invoke them.

like image 892
Karsten Avatar asked Jan 11 '15 12:01

Karsten


1 Answers

You can use the Import-Module command to load a PowerShell module. Therefore, you should be able to use:

Import-Module C:\Temp\7Zip4Powershell.dll
like image 65
Alan Avatar answered Nov 03 '22 16:11

Alan