Compare commits

...

4 Commits

Author SHA1 Message Date
Alexandre B
4e1656a331
Update powershell.md
Some checks failed
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
2024-09-14 17:41:40 -04:00
Alexandre B
5ed00bc281
Update powershell.md 2024-09-14 17:36:28 -04:00
Alexandre B
8d452d4f45
Update powershell.md 2024-09-14 17:32:40 -04:00
Alexandre B
72594efdb1
Update powershell.md 2024-09-14 17:26:34 -04:00

View File

@ -90,11 +90,21 @@ Get-Process -Id 10500 | Stop-Process
# Getting Computer Information
## Get-ComputerInfo
## Get-WmiObject
__Get-WmiObject__ has a parameter called -Class this allows you to specify the WMI object you wish to access. The command below will get a list of WMI
classes, Get-WmiObject -List -Class Win32*
### Class List
- Win32_SystemBIOS
- Win32_Processor
- Win32_OperatingSystem
- Win32_Fan
- Win32_BIOS
- Win32_Account
Once you know the name of the WMI class, you can execute __Get-WmiObject__ to return useful information from a local or remote computer. Below is a list
of the most important WMI classes you may need:
@ -110,6 +120,36 @@ To get information about the operating system, run the command below:
Get-WmiObject -Class Win32_OperatingSystem
```
## Get-CimInstance
```
Get-CimInstance -ClassName CIM_Processor | Where-Object {$_.'DeviceID' -eq 'CPU0'} | ft -HideTableHeaders
```
### To extract CPU information only
```
Get-CimInstance -ClassName CIM_Processor | Select Caption | ft -HideTableHeaders
```
### To extract CPU name only
```
Get-CimInstance -ClassName CIM_Processor | Select Name | ft -HideTableHeaders
```
### To extract CPU manufacturer only
```
Get-CimInstance -ClassName CIM_Processor | Select Manufacturer | ft -HideTableHeaders
```
### Cim-Class List
To get full list of CimClass, run `Get-CimClass`
- Win32_SystemBIOS
- Win32_DiskPartition
- Win32_Processor
- CIM_Processor (DeviceID, Name, Caption, MaxClockSpeed, Manufacturer)
## SYSTEMINFO
__SYSTEMINFO__ displays operating system configuration information for a local or remote computer.