【问题标题】:Get Processor Name in PowerShell 2.0在 PowerShell 2.0 中获取处理器名称
【发布时间】:2017-06-27 16:34:07
【问题描述】:

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

Get-WMIObject win32_Processor

但是当我跑步时:

(Get-WMIObject win32_Processor).Name

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

【问题讨论】:

  • $env:PROCESSOR_IDENTIFIER ?
  • 它对你有用吗?

标签: powershell powershell-2.0 processor


【解决方案1】:

我认为您需要通过 powershell 2.0 中的管道:

这应该在 2.0 中工作:

Get-WMIObject win32_Processor | select name

【讨论】:

    猜你喜欢
    • 2013-10-11
    • 2019-04-12
    • 1970-01-01
    • 1970-01-01
    • 2019-08-17
    • 2010-11-13
    • 1970-01-01
    • 1970-01-01
    • 2021-10-19
    相关资源
    最近更新 更多