Skip to content

Suggestion: Allow a .psd1 to have a schema so that validation and intellisense can be done #4016

@JohnLudlow

Description

@JohnLudlow

In PowerShell it's possible to use a .psd1 file to provide data to a cmdlet. DSC does this for example with its configuration data.

We are developing a module which deals with environment preparation and configuration. It takes a configuration file (.psd1) which contains the required information about the environment.

This could be quite a bit of information so we do plan to use plenty of documentation to tell the users what the file should look like and runtime validation to point out errors. However, it struck me that it would be a nice idea to be able to apply a schema in a similar fashion to XML and JSON schemas. If an editor understands the schema, then it can show intellisense and flag errors.

And it also means that the cmdlet can check for errors by running the schema validation and give consistent errors.

JSON schemas work by adding a $id to the root element which specifies a schema URI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Languageparser, language semantics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions