【问题标题】:Powershell remoting ApplicationArguments not workingPowershell远程处理ApplicationArguments不起作用
【发布时间】:2010-09-24 00:40:05
【问题描述】:

我正在尝试使用 PSSessionOption 的 ApplicationArguments 属性将一些参数传递到新的 Powershell 远程会话中。不幸的是,争论似乎没有出现。

代码如下:

$client = "Bubba"
$options = New-PSSessionOption -ApplicationArguments @{ Client = $client }

Enter-PSSession -ComputerName "Server" -SessionOption $options

$clientName = $PSSenderInfo.ApplicationArguments.Client
$dir = New-Item "c:\temp\$clientName" -type directory

Exit-PSSession

这会导致错误:“NewNotImplementedException at offset 101 in file:line:column...”

我做错了吗?

【问题讨论】:

    标签: remoting powershell-2.0


    【解决方案1】:

    显然 Enter-PSSession 和 Exit-PSSession 在脚本中不起作用!它们仅用于交互式命令行。这就解释了问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-08
      • 1970-01-01
      相关资源
      最近更新 更多