-
Notifications
You must be signed in to change notification settings - Fork 53
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
Environment: Multiple Path entries : a conflict was detected between resources [Environment]SetMySQLBinaryPathVariable and [Environment]PHPPathEnvironmentVariable #59
Comments
+1, this is really implemented poorly. You should definitely be able to set multiple path entries in one configuration. |
The resource is built to handle your scenario like this. If either path in
To remove multiple paths.
I label this issue as documentation and help wanted so that the community can create an example and update the documentation for this. |
I tried to improve the documentation in xPSDesiredStateConfiguration to address this issue, but haven't submitted a similar PR to this repository. I don't exactly know how code moves from experimental resources to non-experimental resources, or if it does at all, but I'll submit similar changes to this repository if they won't make their way here otherwise. (@johlju I wonder if you have any advice for me in that regard?) |
You can see this resource module and xPSDesiredStateConfiguration resource module as separate with there own "life cycle". As this resource module do not allow breaking changes, only bug fixes and accepted enhancements, code are not moved from xPSDesiredStateConfiguration here. Updates to this resource module must be done through PR's. For this issue, please send in a PR and I ask @kwirkykat to review it. |
That example from @johlju partially addresses the issue. But, if I need to add one |
@gwimpey the resource make sure that the environment variable Path (refer to example above) is in desired state, and the resource must be unique in the final compiled mof. The desired state is that it should always have a path present, or always have a path absent - not both. Example (assuming both Name and Enusre is key):
This configuration would never be in desired state. A better solution would be to add two new properties |
Change Initialize-TestEnvironment to loads Module in Global Scope - Fixes PowerShell#59
Fails because the name value must be 'Path' but this this is used as a unique key.
Couldn't find any issues raised regarding this, still a problem in 2.6.0.0.
Is the general accepted solution to use a custom Script resource?
Related:
https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088876-dsc-environment-resource-does-not-allow-duplicate
https://powershell.org/forums/topic/why-are-the-resourcekey-combination-required-to-be-unique/
The text was updated successfully, but these errors were encountered: