0

Facing below variations when I execute a WMI query from WMI browser and powershell

From WMI Browser

Query:

Select Caption  from Win32_TimeZone

Output:

Caption                                      |  StandardName
[UTC+530]Chennai,Kolkata, Mumbai, New Delhi     Indian Standard Time  

From Powershell:

Query:

Get-WmiObject -query  "select caption from Win32_Timezone"

Ouput: enter image description here

Where is StandardName coming from in the WMI browser?

arco444
  • 22,002
  • 12
  • 63
  • 67
Akshobhya
  • 169
  • 2
  • 16
  • Use this `Get-Member -Input (Get-WMIObject Win32_Timezone)` to see what properties that class has. – EBGreen May 14 '18 at 12:30
  • You can run `Get-WmiObject -query "select StandardName from Win32_Timezone"` to see the StandardName, if that's what you're asking – arco444 May 14 '18 at 12:33
  • Hi from WMI browser even if we are not giving StandardName its coming in the results and this is happening for all the WMIObject Ex: Win32_process, the query is "select OSName from win32_process" , Result will give both OSName, Handle not understanding what is the logic behind that – Akshobhya May 15 '18 at 04:17

1 Answers1

0

This will give you the same results:

Get-WmiObject Win32_Timezone | Select Caption,StandardName

or remove the StandardName if not needed.

Get-WmiObject Win32_Timezone | Select Caption
Avshalom
  • 8,657
  • 1
  • 25
  • 43
  • You don't even need the select statement, really. It just returns a pscustomobject instead of the managementobject wmi returns. – Maximilian Burszley May 14 '18 at 13:39
  • of course, but it give the same results the OP need – Avshalom May 14 '18 at 16:52
  • Hi from WMI browser even if we are not giving StandardName its coming in the results and this is happening for all the WMIObject Ex: Win32_process, the query is "select OSName from win32_process" , Result will give both OSName, Handle not understanding what is the logic behind that – Akshobhya May 15 '18 at 04:21