0
0
PowerShellscripting~10 mins

CIM/WMI cmdlets in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to get all running processes using CIM cmdlet.

PowerShell
Get-[1] -ClassName Win32_Process
Drag options to blanks, or click blank then click option'
AGet-WmiObject
BGet-Process
CGet-Service
DGet-CimInstance
Attempts:
3 left
💡 Hint
Common Mistakes
Using Get-Process which does not use CIM/WMI.
Using Get-Service which lists services, not processes.
2fill in blank
medium

Complete the code to filter processes with the name 'notepad' using WMI cmdlet.

PowerShell
Get-[1] -Class Win32_Process -Filter "Name = 'notepad.exe'"
Drag options to blanks, or click blank then click option'
AGet-WmiObject
BGet-Process
CGet-Service
DGet-CimInstance
Attempts:
3 left
💡 Hint
Common Mistakes
Using Get-CimInstance which uses -Query instead of -Filter.
Using Get-Process which does not support -Filter.
3fill in blank
hard

Fix the error in the code to get the operating system info using CIM cmdlet.

PowerShell
Get-CimInstance -ClassName [1]
Drag options to blanks, or click blank then click option'
AWin32_Service
BWin32_Process
CWin32_OperatingSystem
DWin32_ComputerSystem
Attempts:
3 left
💡 Hint
Common Mistakes
Using Win32_Process which lists processes, not OS info.
Using Win32_Service which lists services.
4fill in blank
hard

Fill both blanks to get the total visible memory size from the operating system using CIM cmdlet.

PowerShell
$os = Get-CimInstance -ClassName [1]
$totalMemory = $os.[2]
Drag options to blanks, or click blank then click option'
AWin32_OperatingSystem
BWin32_ComputerSystem
CTotalVisibleMemorySize
DFreePhysicalMemory
Attempts:
3 left
💡 Hint
Common Mistakes
Using Win32_ComputerSystem which does not have this property.
Using FreePhysicalMemory which shows free memory, not total.
5fill in blank
hard

Fill all three blanks to query services that are running using WMI cmdlet.

PowerShell
Get-[1] -Class [2] -Filter "State = '[3]'"
Drag options to blanks, or click blank then click option'
AGet-WmiObject
BWin32_Service
CRunning
DGet-CimInstance
Attempts:
3 left
💡 Hint
Common Mistakes
Using Get-CimInstance which uses -Query instead of -Filter.
Using incorrect class or state value.