如何从 DLL 导入 Cmdlet

Kar*_*ten 5 dll powershell cmdlets build

是否可以从不在 PATH 目录中的 DLL 导入和调用 Cmdlet?

我想用powershell编写一个能够压缩结果的构建脚本。因此我找到了7Zip4Powershell Cmdlets ( Source ),但我无法调用它们。

Ala*_*lan 5

您可以使用 Import-Module 命令加载 PowerShell 模块。因此,您应该能够使用:

Import-Module C:\Temp\7Zip4Powershell.dll
Run Code Online (Sandbox Code Playgroud)