File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -314,18 +314,18 @@ switch ($usrMitigate) {
314
314
# map input variable usrScanScope to an actual value
315
315
if ($EverythingSearch ) {
316
316
Write-Log - Text " Everything search requested. Scanning all possible drives."
317
- $script :varDrives = @ (Get-WmiObject - Class Win32_logicaldisk | Where-Object {$_.DriveType -eq 2 -or $_.DriveType -eq 3 } | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
317
+ $script :varDrives = @ (Get-CimInstance - Class Win32_logicaldisk | Where-Object {$_.DriveType -eq 2 -or $_.DriveType -eq 3 } | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
318
318
} else {
319
319
switch ($usrScanScope ) {
320
320
1 {
321
321
Write-Log - Text " - Scan scope: Home Drive"
322
322
$script :varDrives = @ ($env: HomeDrive )
323
323
} 2 {
324
324
Write-Log - Text " - Scan scope: Fixed & Removable Drives"
325
- $script :varDrives = @ (Get-WmiObject - Class Win32_logicaldisk | Where-Object {$_.DriveType -eq 2 -or $_.DriveType -eq 3 } | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
325
+ $script :varDrives = @ (Get-CimInstance - Class Win32_logicaldisk | Where-Object {$_.DriveType -eq 2 -or $_.DriveType -eq 3 } | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
326
326
} 3 {
327
327
Write-Log - Text " - Scan scope: All drives, including Network"
328
- $script :varDrives = @ (Get-WmiObject - Class Win32_logicaldisk | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
328
+ $script :varDrives = @ (Get-CimInstance - Class Win32_logicaldisk | Where-Object {$_.FreeSpace } | ForEach-Object {$_.DeviceID })
329
329
} default {
330
330
Write-Log - Text " ERROR: Unable to map scan scope variable to a value. (This should never happen!)" - Type ERROR
331
331
Write-Log - Text " The acceptable values for env:usrScanScope are:" - Type ERROR
You can’t perform that action at this time.
0 commit comments