On a Windows Server a logging tool writes .log files to disk continuesly and rotates log files daily at midnight. Every day the new log file gets created, but almost every day its content / meta data does not get updated afterwards in Windows Explorer and Powershell.
Example: A file was created on May 17th, 2022 at 0:00. It has a size of roughly 24KB in Windows Explorer and has a last write time at about midnight (I didn't check the exact time to the second). If I use Powershell
(Get-Item).Length
I get a size of 24401.
Now when I right click the same file the Windows Explorer and inspect its properties it updates the size to 4,593KB and last write time to May 17th, 2022 09:34. The exact time and size does not really matter, but the problem is this: Why is the Windows Explorer and Windows Powershell completeley out of sync with the underlying filesystem like that? What can even cause a discrepancy like this?
Another time I used this to test if the file gets copied out of sync or with the correct content:
Copy-Item ".. source file .." -Destination ".. somewhere .."
the attributes of the original file get updated so I can use that as a really bad workaround to always have the latest version of the file actually available in Powershell as I'm analysing the file with a Powershell script and really need all of its content and not only the content the file had when it was created 9h earlier.
Did anyone ever witness this kind of behaviour in Windows?
- Filesystem: NTFS
- OS: Windows Server 2019 Version 1809 Build 17763.2803
- "Hardware": virtual Server on VMware ESXi Server