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
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
When all the resources in a PowerShellGroup are in the desired state, the group's inDesired state property is false. Looking at the code, I think it is because dsc compares the desiredState with actualState, but in the case of a PowerShellGroup the results are always going to be a single element with InDesiredState or an array of with the resources InDesiredState. Maybe dsc has to special case this group's result.
Expected behavior
Group's inDesiredState should be true if all its resource are in the desired state.
Actual behavior
PS D:\Dev\DSC> dsc resource test -r DSC/PowerShellGroup -i '{ "resources": [ { "name": "test", "type": "xE2ETestResource/E2EFileResource", "properties": { "path": "D:\\Dev\\DscV3\\testv3.txt", "content": "test" } } ] }' 2023-11-21T21:59:55.212660Z INFO dsc_lib::dscresources::command_resource: Invoking test DSC/PowerShellGroup using pwsh at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:232desiredState: resources: - name: test type: xE2ETestResource/E2EFileResource properties: path: D:\Dev\DscV3\testv3.txt content: testactualState: InDesiredState: falseinDesiredState: falsedifferingProperties:- resourcesPS D:\Dev\DSC> dsc resource set -r DSC/PowerShellGroup -i '{ "resources": [ { "name": "test", "type": "xE2ETestResource/E2EFileResource", "properties": { "path": "D:\\Dev\\DscV3\\testv3.txt", "content": "test" } } ] }' 2023-11-21T22:00:40.620243Z INFO dsc_lib::dscresources::command_resource: Getting current state for set by invoking get DSC/PowerShellGroup using pwsh at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:132 2023-11-21T22:00:49.253187Z INFO dsc_lib::dscresources::command_resource: Invoking set DSC/PowerShellGroup using pwsh at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:145beforeState: Path: D:\Dev\DscV3\testv3.txt Ensure: Present Content: ''afterState: RebootRequired: falsechangedProperties:- RebootRequiredPS D:\Dev\DSC> dsc resource test -r DSC/PowerShellGroup -i '{ "resources": [ { "name": "test", "type": "xE2ETestResource/E2EFileResource", "properties": { "path": "D:\\Dev\\DscV3\\testv3.txt", "content": "test" } } ] }' 2023-11-21T22:01:11.628882Z INFO dsc_lib::dscresources::command_resource: Invoking test DSC/PowerShellGroup using pwsh at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:232desiredState: resources: - name: test type: xE2ETestResource/E2EFileResource properties: path: D:\Dev\DscV3\testv3.txt content: testactualState: InDesiredState: trueinDesiredState: falsedifferingProperties:- resources
Error details
No response
Environment data
PS D:\Dev\DSC>$PSVersionTable
Name Value
---------
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Microsoft Windows 10.0.25999
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
v3.0.0-alpha.4
Visuals
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Steps to reproduce
When all the resources in a PowerShellGroup are in the desired state, the group's inDesired state property is false. Looking at the code, I think it is because dsc compares the
desiredState
withactualState
, but in the case of a PowerShellGroup the results are always going to be a single element with InDesiredState or an array of with the resources InDesiredState. Maybe dsc has to special case this group's result.Expected behavior
Group's inDesiredState should be true if all its resource are in the desired state.
Actual behavior
Error details
No response
Environment data
Version
v3.0.0-alpha.4
Visuals
No response
The text was updated successfully, but these errors were encountered: