I am trying to execute the below given code, but its giving an error message
Use Get-Help Get-WmiObject -Parameter filter for more info
get-wmiobject -class win32_logicaldisk -filter "deviceid='c:'"
When you create a filter the value you're testing has to be in quotes if it's a string value
(Get-CimClass -ClassName Win32_LogicalDisk).CimClassProperties['DeviceId']
Name : DeviceID
Same applies to Get-CimInstance
You must be logged in to reply to this topic.