在PowerShell 2.0中获取处理器名称

问题描述 投票:0回答:1

我有许多生产服务器,我正在尝试审核。它们都在不同的网络上,都运行PowerShell 2.0,并且由于时间限制,我无法重启服务器以便将PowerShell升级到更高版本。无论如何,我正在尝试返回处理器的名称。我跑的时候能看到它:

Get-WMIObject win32_Processor

但是当我跑步时:

(Get-WMIObject win32_Processor).Name

它不会返回任何结果。这适用于其他版本的PowerShell,但我无法在2.0中使用它。有人知道解决方法吗?

powershell powershell-v2.0 processor
1个回答
0
投票

我认为你需要在powershell 2.0中通过管道:

这应该在2.0中工作:

Get-WMIObject win32_Processor | select name

© www.soinside.com 2019 - 2024. All rights reserved.