I have created a custom resource ‘SyncShare’ and I can get it to run with expected results if I copy the resource folder to the modulepath on the target node. However, if I try to combine copying that resource to the target and applying it in a single configuration ( see below), the LCM on the target says that the resource isn’t in the psmodulepath --despite the fact that I have used the ‘DependsOn’ property to ensure that the directory exists. In fact, the custom resource is not respecting the dependsOn property at all, since I find that it is always being evaluated before the file resource that would make that resource available. See this configuration fragment:
File Resource_SyncShare
{
Type = “Directory”
DestinationPath = $Node.ResourceRootPath+“\SyncShare”
SourcePath = $Node.ResourceSourcePath+“\SyncShare”
Ensure = “Present”
MatchSource = $True
Recurse = $True
Force = $True
Credential = $Credential
Checksum = “modifiedDate”
}
SyncShare Tools
{
Name = "Tools"
SourceDirectory = $Node.ToolsDirSourcePath
DestinationDirectory = $Node.ToolsDirDestinationPath
ChecksumFileName = "sync.checksum"
Ensure = "Present"
DependsOn = "[File]Resource_SyncShare"
}