PowerShell / DSC

This repo is for the DSC v3 project
MIT License
195 stars 24 forks source link

Need a way to selectively disable individual resources/providers #274

Closed anmenaga closed 5 months ago

anmenaga commented 9 months ago

Prerequisites

Steps to reproduce

An example that I've hit with WMIGroup resource provider: On Win11 it returns ~1300 resource types, making "dsc resource list" output useless if user is interested in other resource types.

Need a way to disable/enable specific resource types/providers (this will help with performance too). Maybe have a config file, that can be edited by the user, that lists disabled resources.

Expected behavior

N/A

Actual behavior

N/A

Error details

No response

Environment data

N/A

Version

3.0.0-alpha.4

Visuals

No response

michaeltlombardi commented 9 months ago

This raises a question about being able to use a configuration file to control how dsc behaves - continually defining options at the prompt will get more and more user-unfriendly as the amount of options increases.

SteveL-MSFT commented 9 months ago

My immediate thought is to have a --recurse type switch to enumerate provider resources (although we'd call it something more user friendly like --include-adapter-resources). We might even consider if used interactive to prompt before dumping out 1300 WMI resources.

michaeltlombardi commented 9 months ago

I'm not opposed to a flag for listing resources from providers as an opt-in flag, but it should probably be an array option, so I could specify which provider resources I want enumerated.

If we consider a hypothetical where I have PSDSC, WMI, and Python providers, I might only want to list the resources for PSDSC or Python.

If we had a --provider option with a builtin all value (enumerate everything), that might be more wieldy.

SteveL-MSFT commented 7 months ago

Let's have the config discussion in https://github.com/PowerShell/DSC/issues/282 and keep this the interactive cmdline discussion.

SteveL-MSFT commented 6 months ago

WG discussed: