Skip to content
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

Add Microsoft.PowerShell.PlatyPS module #497

Open
Gijsreyn opened this issue Nov 3, 2024 · 11 comments
Open

Add Microsoft.PowerShell.PlatyPS module #497

Gijsreyn opened this issue Nov 3, 2024 · 11 comments
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@Gijsreyn
Copy link

Gijsreyn commented Nov 3, 2024

Problem description

With the preview release of Microsoft.PowerShell.PlatyPS, it would be great to include it in the RequiredModules.psd1 and move the task logic to use the new commands.

Verbose logs

N/A

How to reproduce

N/A

Expected behavior

Use Microsoft.PowerShell.PlatyPS.

Current behavior

Uses PlatyPS

Suggested solution

Change the RequiredModules.psd1 to include the module. Update the relevant doc tasks.

Operating system the target node is running

N/A

PowerShell version and build the target node is running

N/A

Module version used

N/A
@johlju
Copy link
Collaborator

johlju commented Nov 3, 2024

It is probably DscResource.DocGenerator tasks that need to be refactored. Are the tasks that runs PlatyPS in Sampler used by anyone?

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Nov 3, 2024
@Gijsreyn
Copy link
Author

Gijsreyn commented Nov 4, 2024

I still use this one: https://github.com/gaelcolas/Sampler/blob/main/.build/tasks/generateHelp.PlatyPS.build.ps1. If you want, I can take a look and rewrite it.

@johlju
Copy link
Collaborator

johlju commented Nov 4, 2024

How much refactor will be needed? Thinking if there gonna be any breaking changes 🤔 But please send in a PR 😊

@Gijsreyn
Copy link
Author

Gijsreyn commented Nov 4, 2024

Tbh, I already wanted to write some code, but spend my time around the winget-dsc area. At least it gave me some thoughts.

The new Microsoft.PowerShell.PlatyPS has new cmdlets. I wanted to introduce a new task, say something like: generateHelp.MSPlatyPS.build.ps1. New cmdlets will be added in here. The challenging part is mostly on the dlls loaded in the background. I think both use YamlDotnet or some other variant. If you install both, assembly loading will fail. I don't know how much modules use the task, but simply replacing PlatyPS in the RequiredModules.psd1 with the new one - would do the trick.

@johlju
Copy link
Collaborator

johlju commented Nov 4, 2024

That problem already exist with the current PlatyPS and is solved by running PlatyPS in a separate session so it is the only module using the dlls. Might need to do the same with this new module.

@Gijsreyn
Copy link
Author

Gijsreyn commented Nov 5, 2024

Do you mind sharing an example Johan? I tried searching for it, but couldn't find it :(

@johlju
Copy link
Collaborator

johlju commented Nov 5, 2024

It’s in the existing task

$generateHelpCommands = @"

@Gijsreyn
Copy link
Author

Gijsreyn commented Nov 5, 2024

Clearly I wasn't watching with my eyes, thanks Johan.

@johlju
Copy link
Collaborator

johlju commented Nov 5, 2024

Also, if you adding a new task, maybe look at DscResource.DocGenerator module and those tasks that generate help for public commands and external help and see if we should remove tasks there that will be covered by any changes here.

@Gijsreyn
Copy link
Author

Gijsreyn commented Nov 9, 2024

@johlju Unfortunately, I stumbled on a barrier. I opened a issue at PlatyPS repository. If you have any suggestions in the meantime to proceed further and see the impact of the change, please give me a shout :)

@johlju
Copy link
Collaborator

johlju commented Nov 9, 2024

Is it the parameter HelpVersion that is the issue? If so I suggest just setting it to the full version stripping the prerelease string, and if there is a change in the future for that property we can just remove the part that stripping prerelease string. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants