【问题标题】:Install Bluetooth Driver on Remote HP Laptop with Powershell使用 Powershell 在远程 HP 笔记本电脑上安装蓝牙驱动程序
【发布时间】:2017-06-09 10:54:12
【问题描述】:

我希望为 30 台 HP Elitebook 840 G3 笔记本电脑安装蓝牙驱动程序,并且希望使用 Powershell 来完成。

我可以在本地执行此操作:

Start-Process "C:\\installer\\bluetooth.sp74472.exe" -argumentlist "/s" -wait

但我似乎无法对远程机器执行此操作:

Invoke-Command -ComputerName $computer -scriptblock {Start-Process "C:\\installer\\bluetooth.sp74472.exe" -argumentlist "/s" -wait}

这个过程根本不会在远程机器上启动......我错过了什么?

【问题讨论】:

  • 安装程序可以在没有用户输入的情况下工作吗?我记得,HP 的 bt-drivers 有点特别……我猜,可能是这个。你看到任何进程启动了吗?其他尝试Invoke-Cimmethod -computername $computername -classname win32_process -name create -arguments "C:\installer\bluetooth.sp74472.exe /S"
  • 谢谢你restless1987,我已经尝试了一系列参数,也没有任何参数,仍然没有响应,我没有看到任何进程开始。我将尝试您建议的脚本并返回结果...
  • 嗨@restless1987,我试过你的代码:Invoke-Cimmethod -computername id-l-00511 -classname win32_process -methodname create -arguments @{commandline = bluetooth.sp74472.exe'; currentdirectory="c:\installer"},它返回一个返回值为9的表。
  • 它返回一个进程 ID 为 {empty} 的表,返回值 {9},PSComputerName {computername}。尽管如此,远程计算机上还是没有任何反应......
  • 这个返回值是path not found (msdn.microsoft.com/en-us/library/aa389388(v=vs.85).aspx)。当您在本地运行 .exe 时,它会在 c:\swsetup 或类似位置创建一个文件夹。你应该有一个蓝牙驱动程序的目录。您可以尝试运行此文件 - 也许exe 不支持此安装方法。 HP 驱动程序并不一致。

标签: powershell driver remote-access invoke-command


【解决方案1】:

在不确切知道您所看到的情况下,我最好的猜测是笔记本电脑尚未配置为允许远程 powershell。

欲了解更多信息:How to run powershell commands on remote computers

在 HP 机器上你需要打开一个提升的 Powershell 会话并输入

Enable-PSRemoting -Force

还要确保您的执行策略已配置。

此人也有类似问题:invoke command on remote machine is not working using powershell

【讨论】:

  • 感谢@Christopher 的评论。客户端的笔记本电脑已经配置为接受远程 powershell 并具有适当的执行策略。发布的代码是安装 Skype、Silverlight 等的较大脚本的一部分。只有在这部分它应该安装蓝牙驱动程序,计算机才会停止响应。它没有给我任何错误消息,它只是停了几个小时......:/
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-30
  • 1970-01-01
相关资源
最近更新 更多