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

Get-DscConfiguration will throw when xWebsite returns $null LogCustomFields #372

Closed
regedit32 opened this issue Jun 18, 2018 · 4 comments
Closed
Labels
bug The issue is a bug.

Comments

@regedit32
Copy link
Member

Get-DscConfiguration is very particular about the data type that is returned. In the MOF String LogCustomFields is defined as an array, but if $website.logFile.customFields.Collection is $null, then $null is being included in the Get return, which is not the same as an empty array. $cimLogCustomFields should be casted as an array.

@johlju
Copy link
Member

johlju commented Jun 19, 2018

@regedit32 Do you have the error message that Get-DscConfiguration is throwing when this happen?

Looking for if we should add an example for testing the types in the unit and/or integration test template.

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Jun 19, 2018
@regedit32
Copy link
Member Author

Here's the error message:

Get-DscConfiguration : GetConfiguration did not succeed.
At line:1 char:1
+ Get-DscConfiguration
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration

johlju pushed a commit that referenced this issue Jun 20, 2018
- Fixed Get-DscConfiguration throw in xWebSite (issue #372).
@johlju
Copy link
Member

johlju commented Jun 20, 2018

@regedit32 submitted an issue PowerShell/DscResource.Tests#239 to track adding tests to test framework or template for this.

@johlju
Copy link
Member

johlju commented Jun 20, 2018

Closing this as this was resolved in PR #373.

@johlju johlju closed this as completed Jun 20, 2018
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Jun 20, 2018
chasewilson pushed a commit to chasewilson/xWebAdministration that referenced this issue Jul 30, 2018
- Fixed Get-DscConfiguration throw in xWebSite (issue dsccommunity#372).
gstorme pushed a commit to gstorme/xWebAdministration that referenced this issue Feb 14, 2020
- Fixed Get-DscConfiguration throw in xWebSite (issue dsccommunity#372).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants