【发布时间】:2015-03-09 08:12:36
【问题描述】:
是否可以从不在 PATH 目录中的 DLL 导入和调用 Cmdlet?
我想用 powershell 编写一个能够压缩结果的构建脚本。因此我找到了7Zip4Powershell Cmdlets (Source),但我无法调用它们。
【问题讨论】:
标签: powershell dll build cmdlets
是否可以从不在 PATH 目录中的 DLL 导入和调用 Cmdlet?
我想用 powershell 编写一个能够压缩结果的构建脚本。因此我找到了7Zip4Powershell Cmdlets (Source),但我无法调用它们。
【问题讨论】:
标签: powershell dll build cmdlets
您可以使用 Import-Module 命令加载 PowerShell 模块。因此,您应该可以使用:
Import-Module C:\Temp\7Zip4Powershell.dll
【讨论】:
$psversiontable 并查看您使用的 CLRVersion - 在 PowerShell 2 中它将是 2.0。