1

我的 PowerShell 环境有两个Expand-Archive命令:

  • Windows 10 -> 来自 Microsoft.PowerShell.Archive (1.0.1.0) 的函数
  • PowerShell 社区扩展 -> 来自 Pscx (3.2.2) 的 CmdLet

我当前的环境默认为 Pscx 的 CmdLet:

PS> (Get-Command Expand-Archive).ModuleName
Pscx

是否有任何语法(完全限定名称)可以从另一个模块调用命令?
我不想卸载 Pscx。

4

1 回答 1

3

您始终可以使用其完全限定的模块名称调用函数。

在您的示例中:

Microsoft.PowerShell.Archive\Expand-Archive -Path $Path -Destination $Dest

认为当您不指定模块时,它会使用最后加载的任何内容

于 2017-12-29T15:17:27.873 回答