【发布时间】: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