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

MSFT_xRDSessionCollection: Workaround for bug in Windows Server 2019 #92

Conversation

RobBiddle
Copy link
Contributor

@RobBiddle RobBiddle commented Mar 17, 2021

MSFT_xRDSessionCollection: Workaround for bug in Windows Server 2019

Pull Request (PR) description

Workaround for Get-RDSessionCollection bug in Windows Server 2019.

This Pull Request (PR) fixes the following issues

Fixes #91

Task list

  • Added an entry under the Unreleased section of file CHANGELOG.md.
    Entry should say what was changed, and how that affects users (if applicable).
  • 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 Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

…on returns ALL Collections when more than one Collection exists, even though -CollectionName is specified
@RobBiddle
Copy link
Contributor Author

@danielboth Is there anything else I need to do for this PR to be accepted?
Any questions about the issue #91 this PR resolves?

@danielboth
Copy link
Member

Hey Rob, are you up for writing a test for this PR as well? For example, you could write a test where the call to Get-RDSessionCollection returns 2 results and then ensure that the correct one is picked from that result. Other than that, PR looks good to me.

@RobBiddle
Copy link
Contributor Author

RobBiddle commented Apr 19, 2021

@danielboth Not sure I follow, that's essentially all I did, selecting the appropriate result if there's more than one Collection.
if ($Collection.count -gt 1) { $Collection = $Collection | Where-Object CollectionName -eq $CollectionName }

Are you wanting an additional test case in https://github.com/dsccommunity/xRemoteDesktopSessionHost/blob/95494e5c06dcebf0241244b61403a00cee3b2d2d/tests/Unit/MSFT_xRDSessionCollection.tests.ps1 with mock data containing more than one Collection?

…RDSessionCollection in Get-TargetResource Test
@RobBiddle
Copy link
Contributor Author

Modified the Mock return to include two Collections.
I'm not sure if that's sufficient or if there needs to be another Should statement to check test return value from Get-TargetResource. I'm thinking that might be enough of a test since it was erroring out previously.

@nyanhp
Copy link
Contributor

nyanhp commented Jul 13, 2022

@danielboth is there anything I can help with to move this PR along? Two of my customers have the same issue, and were able to validate the solution that was proposed here.

Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r1, 1 of 1 files at r2, 1 of 1 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RobBiddle)

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.

MSFT_xRDSessionCollection: Collection related DSC fails when multiple collections are present
4 participants