【发布时间】:2017-01-13 14:45:44
【问题描述】:
我需要验证我们系统上运行的服务的版本。所以我已经接近但似乎无法弄清楚。我正在使用Get-WmiObject 进程来查找正在运行的服务的进程。然后拉回作为“该”服务的可执行文件的路径。然后检索所述可执行文件的FileVersion。
foreach ($Computer in $Computers ) {
$zabbix = Get-WmiObject -Class Win32_Process -ComputerName $computer -Filter "name like '%zabbix%'" |
Select -ExpandProperty Path |
Get-ItemProperty |
Select-Object -Property VersionInfo |
? {$_.ProductVersion}
}
Write-Host "$zabbix - $Computer"
【问题讨论】:
标签: powershell powershell-remoting get-wmiobject