You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Test-TargetResource returns $false even though the file may match the checksum. This is because when deploying a new configuration, it clears the "attribute cache" that's used to tell whether it matches the source or not (as documented).
In my eyes, it's more important that the contents match over the attributes matching the cache. -MatchSource should work with the CheckSum rather than just the cached file attributes alone.
I propose the $fileExists -eq True is removed as it should check the file checksum, no matter if it's in the attribute cache or otherwise. I guess this would mean an extra hash calculation, but if -MatchSource is set, the file hashes should match too.
We use this for a file that gets copied onto a server which becomes locked. We've noticed that DSC xRemoteFile is trying to update this file, even though it shouldn't be touching it -- the hash matches.
The text was updated successfully, but these errors were encountered:
It seems there were no one in the community to reviewed the PR so it could be merge, and the contributor eventually removed the working branch so the PR closed. If someone send in a new PR then someone in the community have a chance to reviewed and we can merge it. 🙂
The
Test-TargetResource
returns$false
even though the file may match the checksum. This is because when deploying a new configuration, it clears the "attribute cache" that's used to tell whether it matches the source or not (as documented).In my eyes, it's more important that the contents match over the attributes matching the cache.
-MatchSource
should work with the CheckSum rather than just the cached file attributes alone.I propose the
$fileExists -eq True
is removed as it should check the file checksum, no matter if it's in the attribute cache or otherwise. I guess this would mean an extra hash calculation, but if-MatchSource
is set, the file hashes should match too.For Files:
xPSDesiredStateConfiguration/source/DSCResources/DSC_xRemoteFile/DSC_xRemoteFile.psm1
Lines 523 to 526 in 475885c
and for Directories:
xPSDesiredStateConfiguration/source/DSCResources/DSC_xRemoteFile/DSC_xRemoteFile.psm1
Lines 575 to 578 in 475885c
We use this for a file that gets copied onto a server which becomes locked. We've noticed that DSC xRemoteFile is trying to update this file, even though it shouldn't be touching it -- the hash matches.
The text was updated successfully, but these errors were encountered: