【问题标题】:Error invoking command to install a Msi through Powershell调用命令通过 Powershell 安装 Msi 时出错
【发布时间】:2015-02-17 07:01:45
【问题描述】:

我正在尝试使用 PowerShell 的 Invoke-Command,但我遇到了一个我不知道它是什么的错误!

在这方面能得到一些帮助会很棒。我敢肯定,这一定是非常简单的事情..

invoke-command  -scriptblock{ $executable = "wmic"; & "$executable product call install true","-computername name" ,'path to the msi' } 

谢谢!

【问题讨论】:

  • @Paul 你知道它可能是什么吗?
  • 因未能包含错误消息而被否决

标签: powershell windows-installer wmic


【解决方案1】:

您可以尝试使用 msiexec:

$scriptblock = {Start-Process msiexec.exe -Argumentlist "/i $PathToMSI","/qn"}
invoke-command  -scriptblock $scriptblock -computername $name 

我不确定你是否可以通过 wmi 安装 msi,以前从未见过。除此之外,您稍微混淆了调用命令的语法;)

【讨论】:

  • 做到了!谢谢!
  • 我做了什么语法混淆?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-02-16
  • 2023-02-03
  • 2018-12-26
  • 2022-01-08
  • 2018-11-26
  • 1970-01-01
  • 2018-03-31
相关资源
最近更新 更多