Microsoft.DSC/Group dependsOn with Microsoft.DSC/Assertion #725
-
Hi team, I am attempting to build a yaml config file for DSCv3 that uses a bit of logic with Assertion to determine what configuration to run. I have these configurations set up as Groups with a dependsOn to an Assertion with a nested OSInfo version check. Here is an example: resources:
- name: Schannel Protocols 2025
type: Microsoft.DSC/Group
properties:
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: TLS 1.3\Client
type: Microsoft.Windows/Registry
properties:
keyPath: HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client
valueName: Enabled
valueData:
DWord: 1
- name: TLS 1.3\Server
type: Microsoft.Windows/Registry
properties:
keyPath: HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server
valueName: Enabled
valueData:
DWord: 1
dependsOn:
- "[resourceId('Microsoft.DSC/Assertion','Server 2025 check')]"
- name: Server 2025 check
type: Microsoft.DSC/Assertion
properties:
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Server 2025
type: Microsoft/OSInfo
properties:
version: "10.0.26100" The Assertion seems to work, however configurations for other Groups in the same yaml file with a dependsOn for their corresponding OS versions are getting applied in order even if their Assertion fails. This is all very new to me, so perhaps I am doing something wrong. Hoping someone can offer some guidance. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Can you perhaps paste in the full YAML that you have and put the expected outcomes for each group / server your applying it to as such: name: Schannel Protocols 2025
type: Microsoft.DSC/Group
properties:
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
# Resources here |
Beta Was this translation helpful? Give feedback.
-
@csoto-dish , coming back to this, probably: https://github.com/PowerShell/DSC/releases/tag/v3.1.0-preview.3 solve the issue, as there was a bug. Can you try it again? |
Beta Was this translation helpful? Give feedback.
@csoto-dish , coming back to this, probably: https://github.com/PowerShell/DSC/releases/tag/v3.1.0-preview.3 solve the issue, as there was a bug. Can you try it again?