[PSS 2016] DSC Project

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 7 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2016] DSC Project

Post by Bosparan »

Hi,

yet another bigger request :)
I'm currently busy building a fairly big DSC resource for one of our customers and it's a pain in the ass to do with PSS:
- Almost none of the files are directly supported by PSS - I always have to keep manually creating the files and importing it as existing file
- Many repetitive steps need to be done manually, when they could be already automatic.
So I got this yearning for ... you know, a project optimized for DSC!
Only ... what features would I actually want?

Well, after spending some brain on it this weekend, I got a proposal worked out:

Structure
A DSC Project consists of three main sections:

Resources
The place where the individual DSC resources are created

Globals
.ps1 scripts that are loaded for each resource. Useful for global function libraries.

Shared
.ps1 scripts that are loaded for some resources, as configured in the resource. This avoids cluttering Primal Sense with helper functions on bigger projects.

Now for the details ...

Resources
The context Menu allows adding, naming and removing resources. Each resource is shown as a single item, even though it represents a folder structure with various contents and properties.
Each resource has - similar to a form - multiple tabs:

Script
Comes with the three base DSC functions predefined. All globals (see below) are available, all shared content that was linked (see below) is available, the localized strings (see below) are available in the "$strings" Variable.

MOF
The base MOF structure predefined. Validates types against the parameters of Set-TargetResource. Validates Get- & Test- against the [key]-Parameter

Strings
A table of strings, mapping key to text. Comes by default with a "Keys"-column and an "en-US"-column. Additional languages (and thus columns) can be added, the default language can be chosen.

Shared
List of all shared scripts (see below). They can be enabled by checking a checkbox. These are available in "script"-view through the $strings variable, for which Primal Sense should be given.

Manifest
The resource Manifest (equivalent to a module manifest. It's optional but good practice)

When publishing a DSC-project, it will generate a DSC module with the appropriate folder structure, generate the .psm1 and .schema.mof files, create a subfolder with the region code of every language that has been added in the strings section, adds the .psd1-files with the strings. The .psm1 file starts importing the globals, the linked shared scripts, the strings and then whatever the user added in the actual script view.

Globals
This is a plain folder view where scripts can be placed and subfolders can be created. All scripts that are set to "Shared" are available in all resources.

Shared
This is again a folder view where scripts can be placed and subfolders can be created. Only these aren't quite regular scripts as PSS handles file types, in that they have a second tab, listing all resources, and shows which use it and which don't (through checkboxes). This allows configuring which shared scripts is available in which resource both at the resource level as well as the shared script level, coming in handy depending on which process of the development you are busy with.


Notes
While I'd really like the entire package of ideas, here's the priority list for me by feature in descending order (top = greatest use):
- Creating everything out-of-the-box within the project
- Abstracting the resource pieces into one document type
- Strings / localization, including Primal Sense
- [some empty space]
- "Shared" feature
So if it comes to culling time, cull the "Shared" feature-part of the idea first ;)

Tests
I've considered adding a section for tests in the proposal above but ... I'm not sure enough yet - I'll need more experience with DSC tests (looking up how Microsoft does those things right now), before I know where best to stuff them and whether they have a solid place as part of the project or not.

Any thoughts / comments on the idea?

Cheers,
Bosparan
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: [PSS 2016] DSC Project

Post by DevinL »

While we currently have DSC support on our wishlist, I'll be sure to make note of your specific requests for the project.

Thanks for the thoughtful suggestion yet again.
DevinL
SAPIEN Technologies, Inc.
This topic is 7 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked