I have a question regarding the usage of Powershell in scan profiles. I've been trying to add a script that checks the free space available for only the C: drive, but I can't seem to get it working. The problem is that once I enter into a dynamic collection and go to set said scanner as a filter, the column selection reads NULL.
Here is the script,
$disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'"
DiskLetter = $disk.DeviceID
FreePercent = [math]::Round(($disk.freespace / 1GB) / ($disk.Size / 1GB) * 100)
FreeSpace = [math]::Round($disk.FreeSpace / 1GB)
DiskSize = [math]::Round($disk.size / 1GB)
And here is the error that I receive:
Please sign in to leave a comment.