The following code snippet to get the directory size of different folders in a local or remote computer. However for some folders (like Windows or Windows.old) it is not calculating the size properly. For other folders it is calculating properly. By properly I mean that comparing the results with Windows Explorer.
$FileSysObj = New-Object -comobject Scripting.FileSystemObject
What can be wrong? I have searched and searched and searched. But no clue.