I'm trying to write a PowerShell script to get some basic information about offline files on Windows 10 computers, including the cache size limit and amount of space in use. It appears that both of these values are stored properties of the WMI class Win32_OfflineFilesDiskSpaceLimit
. As seen here, the properties of this class are:
AutoCacheSizeInMB
(appears to be the space in use)TotalSizeInMB
(appears to be the space allotted)
However, when I attempt to run the following, nothing is returned:
Get-WmiObject -Class Win32_OfflineFilesDiskSpaceLimit
I have confirmed that Win32_OfflineFilesCache
says Active
and Enabled
are both true
.
If there is a better way to gather this information, I am open to suggestions, but I'm still curious why these properties don't seem to exist.
Note: I'm currently using
Measure-Object
on the Offline Files location to get the amount of space in use, but I can't get the limit this way.