PowerShell / PSDesiredStateConfiguration

Source for https://www.powershellgallery.com/packages/PSDesiredStateConfiguration module
MIT License
58 stars 14 forks source link

PSDesiredStateConfiguration 2.0.5 Get-DscResource Returns Incorrect Resources on Windows #72

Closed valainisgt closed 8 months ago

valainisgt commented 2 years ago

Prerequisites

Steps to reproduce

I am experiencing a problem with the PSDesiredStateConfiguration 2.0.5 module. The Get-DscResource function does not return the correct resources when run on windows. The private Get-DscResourceModules function splits the current PSModulePath using a colon instead of the platform specific path separator, which I believe to be the problem.

I have created a repository that demonstrates the problem. The repository has an xUnit.net test project that outlines a couple of scenarios showing the error. I have also documented a potential fix for the issue in the repository at this commit.

Expected behavior

PS> Get-DscResource
# Any dsc resource in PSModulePath

Actual behavior

PS> Get-DscResource
# returns nothing

Error details

No response

Environment data

PSVersion                7.2.2
PSEdition                Core
GitCommitId              7.2.2
OS                       Microsoft Windows 10.0.19043
Platform                  Win32NT
PSCompatibleVersions      {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.0, 7.1.0, 7.2.2}
PSRemotingProtocolVersion 2.3
SerializationVersion      1.1.0.1
WSManStackVersion         3.0

Visuals

No response

valainisgt commented 2 years ago

After some more digging this same issue was uncovered back in 2020 with PowerShell/PSDesiredStateConfiguration#73. I will close this issue if PowerShell/PSDesiredStateConfiguration#73 sufficiently covers what is wrong.

valainisgt commented 8 months ago

Closing because this was fixed in 2.0.6