【发布时间】:2017-02-16 01:13:01
【问题描述】:
总结: 我有几个功能放置在为隐式远程处理而构建的远程 Windows 服务器上。但是,我无法使用 Get-Help cmdlet 来显示我在我创建的每个函数中的概要,因此这些是不是本机 powershell cmdlet。 get-help cmdlet 可以在本地运行的脚本中正常工作。
问题: 隐式远程处理不能使用 Get-Help 吗?
编辑 1。
试图修复布赖恩特派
PS> $module = Import-Module 'tmp_2c0mhyix.ivb' -PSSession $sessVar -PassThru
Import-Module : Failure from remote command: Import-Module -Name 'tmp_2c0mhyix.ivb': The specified module 'tmp_2c0mhyix.ivb' was not loaded because no valid module file was found in any module directory.
At line:1 char:11
+ $module = Import-Module 'tmp_2c0mhyix.ivb' -PSSession $sessVar-Pa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (tmp_2c0mhyix.ivb:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
在没有模块名称的情况下也尝试过。
PS> $module = Import-Module -PSSession $sessVar-PassThru
Import-Module : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:11
+ $module = Import-Module -PSSession $sessVar-PassThru
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Import-Module], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.ImportModuleCommand
【问题讨论】:
-
如果你有模块名称,你不需要重新导入它,只需将它与
Get-Command一起使用即可。此外,我并不是要暗示这些命令会修复任何问题(它们不会),只是为了让您了解隐式远程处理的实现方式。
标签: powershell