Skip to content

Conversation

@raandree
Copy link
Collaborator

@raandree raandree commented May 22, 2023

Pull Request

Pull Request (PR) description

For WindowsFeatures to use the old WindowsFeature DSC Resource use of PSDesiredStateConfiguration, use UseLegacyResource.

Changed

  • Moved the configurations WindowsFeatures and WindowsOptionalFeature to xPSDesiredStateConfiguration.

Task list

  • The PR represents a single logical change. i.e. Cosmetic updates should go in different PRs.
  • Added an entry under the Unreleased section of in the CHANGELOG.md as per format.
  • Local clean build passes without issue or fail tests (build.ps1 -ResolveDependency).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is Reviewable

@raandree raandree requested a review from nyanhp May 22, 2023 19:19
@nyanhp
Copy link
Contributor

nyanhp commented May 23, 2023

@raandree any reason why we keep using WindowsFeature then? We could just move to xWindowsFeature instead like you did with the optional features. I don't see a reason why we wouldn't do this, as the signature of those composites does not change. The module xPsDesiredStateConfiguration is required anyway, so keeping the old WindowsFeature resource seems unnecessary.

@raandree
Copy link
Collaborator Author

The old WindowsFeature resource offers the parameter Source which was not yet added to xWindowsFeatures. I am not sure but maybe this is required in some scenarios.

WindowsFeature [String] #ResourceName
{
    Name = [string]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Ensure = [string]{ Absent | Present }]
    [IncludeAllSubFeature = [bool]]
    [LogPath = [string]]
    [PsDscRunAsCredential = [PSCredential]]
    [Source = [string]]
}

xWindowsFeature [String] #ResourceName
{
    Name = [string]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Ensure = [string]{ Absent | Present }]
    [IncludeAllSubFeature = [bool]]
    [LogPath = [string]]
    [PsDscRunAsCredential = [PSCredential]]
}

@nyanhp nyanhp merged commit 27e8e53 into dsccommunity:main May 23, 2023
@raandree raandree deleted the feature/MoveToXPSDesiredStateConfiguration branch May 23, 2023 11:02
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.

2 participants