Gather OS and HW Information

  • Get-Counter

  • Get-CimInstance

  • Get-WmiObject

  • Get-EventLog

Get-Counter

Gets performance counter data from local and remote computers.

Get-Counter
# Output1
Get-Counter -ListSet *memory*
# Output2
Get-Counter -ListSet *memory* | where CounterSetName -eq "Memory"
# Output3
Get-Counter -ListSet *memory* | where CounterSetName -eq "Memory" | select -Expand Paths
# Output4
Get-Counter "\Memory\% Committed Bytes In Use"
# Output5

Get-CimInstance

Gets the CIM instances of a class from a CIM server.

  • Below 2 commands have exactly same output when using Get-WmiObject

  • However, they expose different methods and properties

Get-WmiObject

Gets instances of WMI classes or information about the available classes.

  • Below 2 commands have exactly same output when using Get-CimInstance

  • However, they expose different methods and properties

Get-EventLog

Gets the events in an event log, or a list of the event logs, on the local or remote computers.

Last updated