Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted resource list to be sorted #126

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Converted resource list to be sorted #126

merged 1 commit into from
Aug 3, 2023

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Aug 3, 2023

PR Summary

Old HashMap was very annoying when looking through results of dsc.exe resource list because two similarly named resources from the same module could be placed in opposite sides of the list.
Changing storage collection to a B-Tree automatically solves this problem while maintaining good performance.

Before change:

PS C:\DSCv3> dsc.exe resource list

Type                                                     Version  Requires             Description
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PsDesiredStateConfiguration/MSFT_WaitForSome                      DSC/PowerShellGroup
DSC/ParallelGroup                                        0.1.0                         All resources in the supplied configuration run concurrently.
Test/TestGroup                                           0.1.0
Microsoft/OSInfo                                         0.1.0                         Returns information about the operating system.
DSC/AssertionGroup                                       0.1.0                         `test` will be invoked for all resources in the supplied configuration.
Test/TestResource2                                       1.0.1    Test/TestGroup       This is a test resource.
PsDesiredStateConfiguration/MSFT_EnvironmentResource              DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_GroupResource                    DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ScriptResource                   DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ArchiveResource                  DSC/PowerShellGroup
PackageManagement/MSFT_PackageManagementSource           1.4.8.1  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_RegistryResource                 DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_LogResource                      DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WaitForAll                       DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ServiceResource                  DSC/PowerShellGroup
PowerShellGet/MSFT_PSRepository                          2.2.5    DSC/PowerShellGroup
DSC/Group                                                0.1.0                         All resources in the supplied configuration is treated as a group.
Test/TestResource1                                       1.0.0    Test/TestGroup       This is a test resource.
PsDesiredStateConfiguration/MSFT_UserResource                     DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ProcessResource                  DSC/PowerShellGroup
DSC/PowerShellGroup                                      0.1.0                         Resource provider to classic DSC Powershell resources.
PowerShellGet/MSFT_PSModule                              2.2.5    DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WaitForAny                       DSC/PowerShellGroup
PackageManagement/MSFT_PackageManagement                 1.0.0.1  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_RoleResource                     DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WindowsOptionalFeature           DSC/PowerShellGroup
Microsoft.Windows/Registry                               0.1.0                         Registry configuration provider for the Windows Registry
PsDesiredStateConfiguration/MSFT_PackageResource                  DSC/PowerShellGroup

After change:

PS C:\DSCv3> dsc.exe resource list

Type                                                     Version  Requires             Description
--------------------------------------------------------------------------------------------------------------------------------------------------------------
DSC/AssertionGroup                                       0.1.0                         `test` will be invoked for all resources in the supplied configuration.
DSC/Group                                                0.1.0                         All resources in the supplied configuration is treated as a group.
DSC/ParallelGroup                                        0.1.0                         All resources in the supplied configuration run concurrently.
DSC/PowerShellGroup                                      0.1.0                         Resource provider to classic DSC Powershell resources.
Microsoft.Windows/Registry                               0.1.0                         Registry configuration provider for the Windows Registry
Microsoft/OSInfo                                         0.1.0                         Returns information about the operating system.
PackageManagement/MSFT_PackageManagement                 1.0.0.1  DSC/PowerShellGroup
PackageManagement/MSFT_PackageManagementSource           1.4.8.1  DSC/PowerShellGroup
PowerShellGet/MSFT_PSModule                              2.2.5    DSC/PowerShellGroup
PowerShellGet/MSFT_PSRepository                          2.2.5    DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ArchiveResource                  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_EnvironmentResource              DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_GroupResource                    DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_LogResource                      DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_PackageResource                  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ProcessResource                  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_RegistryResource                 DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_RoleResource                     DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ScriptResource                   DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_ServiceResource                  DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_UserResource                     DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WaitForAll                       DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WaitForAny                       DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WaitForSome                      DSC/PowerShellGroup
PsDesiredStateConfiguration/MSFT_WindowsOptionalFeature           DSC/PowerShellGroup
Test/TestGroup                                           0.1.0
Test/TestResource1                                       1.0.0    Test/TestGroup       This is a test resource.
Test/TestResource2                                       1.0.1    Test/TestGroup       This is a test resource.

@SteveL-MSFT SteveL-MSFT merged commit ff41a44 into main Aug 3, 2023
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the sortedList branch August 3, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants