Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
xSQLServerDatabase: Get-TargetResource tests aren't giving accurate results due to scoping. #849
Details of the scenario you tried and the problem that is occurring:
The tests for Get-TargetResource are providing inaccurate results as the second It block in each Context is effectively doing
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
I'm working on some changes to this Resource anyway so I'll fix this as part of that (or I can separate it out to different set of changes). I'm not sure if this is done elsewhere so it might effect other resources too.
This is the code, I'll just move the $testParameters assignment and the $result = Get-TargetResource outside the It block so it's part of the Context above it.
Thanks for finding this.
Instead of moving it outside the It-block, add another
You decide if you can do this change in the same PR as another change, or in a separate PR. Either works for me.