DscWorkshop icon indicating copy to clipboard operation
DscWorkshop copied to clipboard

Issues with Depends on

Open Br4v3St4rr opened this issue 4 years ago • 3 comments

In the following Example:

Disks:
  Disks:
    - DiskId: 2
      DiskIdType: Number
      DriveLetter: F
      PartitionStyle: GPT
      FSFormat: NTFS

FilesAndFolders:
  Items:
    - DestinationPath: F:\ReleaseA\Admin
      Type: Directory
      Ensure: Present
      DependsOn: '[Disk]2'

DependsOn: '[Disk]2' Throws an error and the resource seems to be malformed? Perhaps this is just user error?

Br4v3St4rr avatar Sep 29 '21 07:09 Br4v3St4rr

Well, using 'DependsOn' is an issue at the moment. I have solved that but the solution is not yet public. I should have some time to in the evening to write a detailed description of the solution.

raandree avatar Sep 29 '21 07:09 raandree

The short answer though is that it should either be handled by the composites for DependsOn within a composite, or the DependsOn should be at the Composite level for dependencies between composites. So I assume it's more of a CommonTasks issue.

gaelcolas avatar Sep 29 '21 08:09 gaelcolas

No, @gaelcolas, unfortunately it is more a DSC issue doing too many checks on the format if the DependsOn value. I need to go back in the commit history of one of the projects to find the details.

And the more complex the config data gets, the more you need to make dependencies between individual resources defined in different composites.

raandree avatar Sep 29 '21 08:09 raandree