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

Provide ability to define dsc-v3 resource path (Support sxs installation) #133

Closed
BerheAbrha opened this issue Aug 3, 2023 · 6 comments · Fixed by #176
Closed

Provide ability to define dsc-v3 resource path (Support sxs installation) #133

BerheAbrha opened this issue Aug 3, 2023 · 6 comments · Fixed by #176
Assignees
Labels
Issue-Enhancement The issue is a feature or idea

Comments

@BerheAbrha
Copy link

BerheAbrha commented Aug 3, 2023

Summary of the new feature / enhancement

dscv3 is relying on system variable ($env:path) for resource discovery. Provide an ability to specify the directory for all dscv3 resources.
- This will enable sxs installation possible. (GC-Agent supports this)
- DSC is slow locating resources since it is checking a big list of paths in $env:path.

Proposed technical implementation details (optional)

Pass optional DSC_Resouce_Path to DSC .
No response

@BerheAbrha BerheAbrha changed the title Support ability to define environment for resources (Support sxs installation) Provide ability to define dsc-v3 resource path (Support sxs installation) Aug 3, 2023
@michaeltlombardi
Copy link
Collaborator

One workaround for this (which I've used in the past) is to override the PATH variable in the process that's running DSC. Higher order tools may want to do this anyway, even when the user isn't specifying an alternate path.

@anmenaga anmenaga added the Issue-Enhancement The issue is a feature or idea label Aug 4, 2023
@anmenaga
Copy link
Collaborator

anmenaga commented Aug 4, 2023

  1. good idea about having an ability to overload %PATH% with custom location with resources;
  2. By itself DSCv3 resource enumeration performance is actually quite good at this point; what makes it look slow is PowerShellGroup resource / PSDesiredStateConfiguration module. There are ways to disable it, for example rename it's json to not end with dsc.resource.json.

@SteveL-MSFT
Copy link
Member

If GC-Agent is spawning dsc, it can set the PATH in the env block of the new process to constrain it's search and allow for side-by-side

@BerheAbrha
Copy link
Author

Overwriting the system $env:path in the process may impact locating executable or other resource dependencies that are already under $env:path

@Bpoe
Copy link
Collaborator

Bpoe commented Aug 10, 2023

I agree with BerheAbrha. Resources called and the processes spawned calling those may depend on PATH being intact. We will need to support either specifying the search path(s) as an argument or support another ENV var that would be used if specified instead of PATH. (Think something similar to PSModulePath)

@SteveL-MSFT
Copy link
Member

We can have a DSC_RESOURCE_PATH env var that, if defined, overrides any search of PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants