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

Can't import a specific resource #47

Closed
jdhitsolutions opened this issue Mar 14, 2017 · 14 comments
Closed

Can't import a specific resource #47

jdhitsolutions opened this issue Mar 14, 2017 · 14 comments
Labels
bug The issue is a bug. external The issue cannot be resolved within the DSC Resource Kit.

Comments

@jdhitsolutions
Copy link

I am finding this module challenging to use since there are naming conflicts with PSDesiredStateconfiguration. But for now I am trying to use this in a DSC Configuration

Import-DscResource -ModuleName "PSDscResources" -ModuleVersion "2.5.0.0" -Name "User"

But both the ISE and VSCode give me an error that the resource can't be found. I know the syntax is correct because this line parses correctly.

Import-DscResource -ModuleName "xTimeZone" -ModuleVersion "1.6.0.0" -name "xtimezone"
@kwirkykat
Copy link
Member

@jdhitsolutions What is your full PowerShell/WMF version?

@jdhitsolutions
Copy link
Author

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.15055.0                                                                             
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.15055.0                                                                            
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

@jdhitsolutions
Copy link
Author

I still think there is something funky with DSC and PSDscResources and PSDesiredStateconfiguration. If I try to use this in a config:

Import-DSCresource -ModuleName PSDesiredStateConfiguration -name User
Import-DscResource -ModuleName
@{ModuleName="xPSDesiredStateConfiguration";ModuleVersion="5.0.0.0"},
   @{ModuleName="xComputerManagement";ModuleVersion="1.8.0.0"},
   @{ModuleName="xNetworking";ModuleVersion="3.0.0.0"},
   @{ModuleName='xWindowsUpdate';ModuleVersion = '2.5.0.0'}

I still get this error:

ImportClassResourcesFromModule : Exception calling
"ImportClassResourcesFromModule" with "3" argument(s): "Resource
name 'WindowsPackageCab' is already being used by another Resource or
Configuration."

Even running the config in new PowerShell session with no profiles.

@kwirkykat
Copy link
Member

So you aren't importing PSDscResources in your config and this error is still showing up?

This is similar to #43

@jdhitsolutions
Copy link
Author

I get errors whether I import it or not. I have tried numerous combinations and the only thing that works is to uninstall PSDscResources. It looks like xPSDesiredStateConfiguration is automatically imported whether you specify it or not and I wonder if that is trying to automatically load something else.

So I see two symptoms here and they may be related. 1 - You can't import a resource by name. 2 - PowerShell reports resource name conflicts between this module and PSDesiredStateConfiguration.

@jdhitsolutions
Copy link
Author

Fine -- if you want to close this but even after looking at #43 I don't think you've really addressed this issue. I'll come up with a set of steps to repro and and re-post an issue.

@kwirkykat kwirkykat reopened this Mar 14, 2017
@kwirkykat
Copy link
Member

Sorry didn't mean to do that

@kwirkykat
Copy link
Member

kwirkykat commented Mar 14, 2017

Does importing PSDscResources by itself even work?
This looks like a different WMF version than I have on my test machines.
So I'm thinking this must be a regression of a previous bug that we fixed in the DSC engine that did not allow overwriting of in-box resources.
I'm looking into it

@kwirkykat kwirkykat added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Mar 14, 2017
@kwirkykat
Copy link
Member

@jdhitsolutions Where is your version of WMF coming from?

I am using 5.1.14409.1005 (the newest version I know of that you can download here) and I can also confirm that it works on 5.1.14393.693 which I have on a test box.

Since your version is 5.1.15055.0 I would expect it to be newer than the versions I have. However, the version of WMF 5.1 that went out as the 'WMF 5.1 Preview' was something like 5.1.14394.0 which looks newer than 5.1.14393.693 but was actually from a different branch of code that didn't have the right DSC engine bug fix yet so it was actually older code.

@kwirkykat
Copy link
Member

@jdhitsolutions Are you on Windows Server 2016/Windows 10?

@kwirkykat
Copy link
Member

@jdhitsolutions Is this WMF from an Insider build?

@kwirkykat
Copy link
Member

@jdhitsolutions Aha! This is the latest Windows Insider build that was released last week. I have opened this bug with DSC. I am marking this bug as external for now since there is nothing I can do in this repository/module to fix this.

@kwirkykat kwirkykat added the external The issue cannot be resolved within the DSC Resource Kit. label Mar 14, 2017
@jdhitsolutions
Copy link
Author

Ok. I'll try to test with another Win10 client that isn't on the Insider Build ring or 5.1 on Windows 8.1

@jdhitsolutions
Copy link
Author

jdhitsolutions commented Mar 15, 2017

I guess life in the fast lane has its ups and downs. Got a new build last night and re-running the same configs now works as expected without any of the errors I reported.

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.15058.0                                                                             
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.15058.0                                                                            
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

And this was with v2.5 of the module installed.

@kwirkykat kwirkykat removed the in progress The issue is being actively worked on by someone. label Mar 24, 2017
X-Guardian pushed a commit to X-Guardian/PSDscResources that referenced this issue Jun 4, 2019
converting files to UTF-8 and updating module paths
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. external The issue cannot be resolved within the DSC Resource Kit.
Projects
None yet
Development

No branches or pull requests

2 participants