Skip to content

Add formatting and type extension DSL #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ThomasNieto
Copy link

@iSazonov
Copy link
Contributor

I don't see more value switching from XML to the DSL. This is just a copy. We have more power idea to use PowerShell classes (Jason's PSMore).

@ThomasNieto
Copy link
Author

ThomasNieto commented Feb 20, 2020

@iSazonov Do you have any new information to share on the status of PSMore and an estimated completion date? The last update I saw was on PowerShell/PowerShell#7857 where Jason said there had been no progress since the last commit. The comment was over a year ago and the last commit he referred to was two years ago. If this is still the case, it’s a stale project with no one actively working on it.

I understand the desire to overhaul the formatting system but PSMore is a longer-term project. This RFC is to address the community desire to use the existing .NET classes to create formatting definitions. PowerShell’s built-in formatting definitions are a great example, they used to use XML files but have transitioned over to using C# classes. The same motivation in that move is here.

XML schema validation only gets you so far in ensuring that PowerShell will accept the ps1xml file. The error messages produced when importing a ps1xml file is difficult to troubleshoot at best and people just don’t have that patience so, most module authors just don’t ship ps1xml files at all.

The specification is built using the existing PSControl builder methods. The DSL implements all existing features. That is why the specification has similarities between the XML schema and .NET classes. This RFC does not propose overhauling the PSControl classes and as such any DSL design will not be revolutionary.

@iSazonov
Copy link
Contributor

@ThomasNieto ps1xml files are not things that users do on every day basis. In contrast, they use console formatting continuously. Thus, investments in a project like PSMore are more justified.

@JamesWTruher
Copy link
Contributor

i think if this was coupled with a way to dynamically add formatting without a ps1xml file, it would be much more powerful. A couple of APIs could be created (or made public) which would make this RFC far more interesting. see this gist for an example of embedded formatting (using reflection)

@JamesWTruher
Copy link
Contributor

@PowerShell/powershell-committee reviewed this and think an implementation of this to create ps1xml files would be suitable for the gallery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants