Need resource definition caching
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest version
- [X] Search the existing issues.
Steps to reproduce
Currently each dsc.exe operation as a first step performs resource discovery available on the system.
This is relatively slow process especially for resource providers like DSC/PowerShellGroup.
On the other hand, resource definitions do not change often, so their caching will help a lot with speed of dsc.exe operations.
Expected behavior
NA
Actual behavior
NA
Error details
No response
Environment data
NA
Version
v1
Visuals
No response
Here is the current list of properties
$resourceOutput = [resourceOutput]@{
type = $Type
version = $r.version.ToString()
path = $r.Path
directory = $r.ParentPath
implementedAs = $r.ImplementationDetail
author = $r.CompanyName
properties = $r.Properties.Name
requires = $requiresString
}
I would like to propose that we do not need "Directory" nor "Author". Thoughts?
I would also propose that we need a -full parameter on dsc resource list that returns all of this information.
Finally, I would suggest that dsc resource cache information could be stored in the following locations.
Windows:
[systemdrive]:/programdata/microsoft/dsc/resource.json
Linux:
/var/lib/microsoft/dsc/resource.json
@mgreenegit couple of thoughts:
- good idea on locations of cache file:
[systemdrive]:/programdata/microsoft/dsc,/var/lib/microsoft/dsc - the format of cache file: it probably should be the format that supports the fastest read/write to the cache. Usually this means a binary, not-human-readable (i.e. not JSON), format.
This is implemented for PS-class-based DSC resources that go through PS adapter; This also needs to be done for new DSCv3 native resources.
Resolved for PowerShell group resource