Comments (7)
@csharmath Odd. I can't get it to reproduce either. The only difference I have here is that I didn't import xWebAdministration because I don't currently have that module on my test VM. Can you try separating the two module imports into different lines?
Like this:
Import-DscResource -ModuleName xWebAdministration
Import-DscResource -ModuleName PSDesiredStateConfiguration
I have seen this error before but it only came up when this code was written:
Import-DscResource -ModuleName PSDscResources, PSDesiredStateConfiguration
And the fix for that is to separate the imports into two lines.
from psdscresources.
Hey, sorry for the slow response.
Seems like I can't reproduce it either now.
Looking at patching, I can see lots of hotfixes installed on that server since then.
When I've tried it was a fresh build from a not so fresh image, so it can very well be that some of the hotfix fixed it then.
Looking at the patches, the first one is from 3/14/2016 so thats almost a years worth of patches which is a lot.
WMF 5.1 was manually installed.
I guess the lesson learned for me is to double check that the patching is done before I start working on new builds / get the base image updated.
If someone landed here from a google search: patch & retry :)
Thanks @kwirkykat & @mbreakey3 for taking a look as well!
from psdscresources.
I was able to work around this by adding a try/catch swallow as shown in the gist
https://gist.github.com/csharmath/f2918d4f0dc7e14bdff1fa579b49ebbb#file-psdesiredstateconfiguration-psm1-L2108
But I was not yet able to figure out the root cause and this does not seem like the best way to go of course.
Any ideas on how to debug this ?
Thanks
from psdscresources.
Is this only coming up on 2012 R2? Sorry for the late response, I was trying to repro your issue but it wasn't coming up on my machine (2016 nor 2012 R2). It looks like it could be an issue with PSDesiredStateConfiguration rather than PSDscResources. Have you tried importing PSDesiredStateConfiguration first and then PSDscResources to see if the issue still comes up?
from psdscresources.
Yes, Server 2012R2.
I guess it's environment specific, so some combination of settings/installed modules, env vars, etc. not sure yet what exactly, but will try to remove things / set them to defaults...
from psdscresources.
Have you tried running Get-Module -ListAvailable to see if there's any duplicates listed there?
from psdscresources.
@csharmath Odd. I can't get it to reproduce either. The only difference I have here is that I didn't import xWebAdministration because I don't currently have that module on my test VM. Can you try separating the two module imports into different lines?
Like this:Import-DscResource -ModuleName xWebAdministration Import-DscResource -ModuleName PSDesiredStateConfigurationI have seen this error before but it only came up when this code was written:
Import-DscResource -ModuleName PSDscResources, PSDesiredStateConfigurationAnd the fix for that is to separate the imports into two lines.
I had the same error using an entirely different set of modules.
I was able to solve it by separating import-dscresource statements.
from psdscresources.
Related Issues (20)
- setGroup: Error when I try to exclude a user from Users builtin group HOT 3
- Package missing build number in version Metadata HOT 2
- Set-StrictMode behavior breaks valid Configurations from (x)PSDesiredStateConfiguration HOT 3
- PsDscRunAsCredential with empty password throws error "Object reference not set to an instance of an object."
- Script Resource "No user exists"
- WindowsOptionalFeature: Get Method fails if OptionalFeature has no custom properties when called by the LCM.
- Archive: Special Characters not supported in file names within zip files
- WindowsFeatureSet broken when using member Source HOT 3
- Environment: Implement 'User' target HOT 1
- File: Default checksum type not documented
- Service: Invoke-DscResource fail to update a service HOT 3
- Fix CI Pipeline Failures
- Registry: Set "Absent" with ValueData fails if Key uses "HKEY_LOCAL_MACHINE\..." HOT 1
- Registry: add option to require reboot after setting
- User: Test-DscResource fails for user that is disabled by resource
- Archive: DSC resouce does not support paths longer than 260
- MSFT_GroupResource: SAMR can be blocked by domain controller GPO in Get-TargetResource HOT 1
- Group: Get-TargetResource throws with single member in group due to Type mismatch HOT 2
- WindowsFeature: Resource thinks Windows Server 2022 Azure Edition Core is a Client OS HOT 1
- WindowsProcess DSC resource fails intermittently with "Failed to wait for processes to start." HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psdscresources.