Using the File provider in DSC - Ensure Destination only contains files from Source
I've created a DSC resource to copy a Modules directory from a certain source. I'm testing it for a broader deployment in my environment. The resource does a great job ensuring all the files are there and that they match the source content, so far so good... The problem is this; I want to ensure that if there are any additional files in the target, or destination, a folder that they get removed. Here's my code: Configuration TestRun { Param ( $ComputerName = 'Localhost' ) Node $ComputerName { File LoadModules { Ensure = 'Present' Type = 'Directory' Force = $true Recurse = $true SourcePath = "C