-
Notifications
You must be signed in to change notification settings - Fork 36
WindowsPowerShell adapter should not discover resources unavailable in Windows PowerShell #707
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
Comments
I'm just guessing in the dark here a bit. I was looking at the code, and I think the main responsible commands are: $DscResources = Get-DscResource
$Modules = Get-Module -ListAvailable With a combination of the Strange? Yes. A bug? Maybe... EDIT 1: Found the following issue on PowerShell repo that might be related |
This is affecting our ability to use
The DSC resources are only in 2.2.5, not the 1.0.0.1 that is in Windows PowerShell by default. I wonder if the adapter sees that there is a Windows PowerShell module and lets it win despite the resources not actually being present there...
|
I think what I'll do is in the winps adapter, scrub out all ps7 paths in PSModulePath |
Prerequisites
Summary
In #698, a user reported an error trying to use a PSDSC resource with the
Microsoft.Windows/WindowsPowerShell
adapter. In that case, the root issue was that even though the adapter discovered a resource, it couldn't be used in the adapter because the PSDSC resource module was installed to a PowerShell module path, not in the Windows PowerShell module path.The Windows PowerShell adapter should only discover and advertise resources usable in Windows PowerShell.
Checking my
WindowsPSAdapterCache.json
file showed PowerShell module folders alongside Windows PowerShell module folders, indicating the discovery process is somehow including modules that may have PSDSC resources but can't be discovered by the Windows PowerShell adapter and lead to confusing errors.Steps to reproduce
dsc resource list --adapter Microsoft.Windows/WindowsPowerShell
WindowsPSAdapterCache.json
file for modules not discoverable by Windows PowerShell.Expected behavior
The cache only includes modules available in Windows PowerShell.
Actual behavior
The module includes PowerShell module paths as well as Windows PowerShell paths.
Error details
Environment data
Version
3.0.0
Visuals
No response
The text was updated successfully, but these errors were encountered: