Welcome › Forums › DSC (Desired State Configuration) › Salted PsDscRunAsCredentials considered conflicting values
- This topic has 5 replies, 2 voices, and was last updated 3 years, 4 months ago by
Keymaster.
-
AuthorPosts
-
-
August 27, 2017 at 8:14 pm #78141PowerShell12345678910foreach ($node in $nodes) {Script $node {DependsOn = xxxPsDscRunAsCredential = $DomainCredsGetScript = { xxx }TestScript = { xxx }SetScript = { xxx }}}}
The above code fails to run when credentials are encrypted. This looks like a bug, is it? why does it even complain, as those resources have different ID’s. Using wmf 5.1
error:
PowerShell1The resources ('[script]node1' and '[script]node2') have conflicting values of following properties: 'PsDscRunAsCredential'. Ensure that their values match.on the mof itself it says something like:
PsDscRunAsCredential = MSFT_CREDENTIAL_REF1 for the first resource and PsDscRunAsCredential = MSFT_CREDENTIAL_REF2 for the second. Which makes little sense (i understand why it says so, but I mean, why would it complain about that), but I cant control it anyway so, wth?
-
August 28, 2017 at 3:42 pm #78174
I’m not sure why they’re taking PsDscRunAsCredential as a key property – that does seem wrong. I’d file an issue on GitHub. But the ID isn’t the problem – that isn’t a key property, so its uniqueness doesn’t matter here.
-
August 28, 2017 at 4:21 pm #78181
what do you mean resourceId uniquness doesnt matter? I cant have 2 script resources in the same configuration unless they are identical (so useless)?
But anyway, how do I create several script resources if this behaves like this?
ps. there was an issue already (https://github.com/PowerShell/PowerShell/issues/4138) which got closed… so any point in opening another one?
-
August 28, 2017 at 6:19 pm #78192
Each resource defines for itself one or more “key properties.” Like, with the File resource, it’s the UNC, I think. Anyway, you can only define one resource block with a given key property value. Yes, the ID you assign – Node1, Node2 – does have to be unique, but that isn’t the only thing which has to be unique. No given resource can share the same key property values.
In this case, it would seem that the PSRunAsCredential is somehow being taken as a key property, meaning you can only use it once per configuration. That’s obviously dumb.
That issue was correct, but it was opened in the wrong place. I think you need to open it at https://github.com/PowerShell/DscResources.
-
August 28, 2017 at 6:47 pm #78196
but the set-script properties are also different (at least when expanded). so how does it check for uniqueness?
-
August 28, 2017 at 7:18 pm #78199
The schema MOF for the resource determines what’s considered a key property. The Get/Set/Test aren’t, so they don’t count.
-
-
AuthorPosts
- The topic ‘Salted PsDscRunAsCredentials considered conflicting values’ is closed to new replies.