Support URI on dsc config
Summary of the new feature / enhancement
As a user, I want the ability to specify a URI to a configuration document. This removes the step to pull down the configuration document file and allows me to directly point towards it as such:
dsc config get --file https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/dsc/examples/assertion.dsc.yaml
Proposed technical implementation details (optional)
No response
I'm not sure that the tool should handle this - the alternative here would be something like
Invoke-WebRequest $url |
Select-Object -ExpandProperty Content |
dsc config get --file -
or
curl $uri | dsc config get --file -
Having DSC handle URIs for --file and downloading content directly in general requires expanding the vulnerability surface of the tool for web requests. I think this functionality is better left to higher order tools / workflows, but I'm open to different perspectives.
I was already a little afraid of that, but the idea came from the winget CLI. It's already supported there, and with the ongoing development to integrate DSC in it, I guess you already have your first higher order tool that does it.
Hopefully, this will be alternately resolved once people can package and publish configurations and resources to a repository - rather than pulling a configuration document and immediately applying it, you could search for, review, and save configurations for re-use. This will be more important later on when the default settings for DSC may require signed files, attestations, etc.