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

Convert from pode yaml #1382

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Sep 7, 2024

Description

This function is doing exactly the reverse of ConvertTo-PodeYaml.
But the logic is the same if an external module is available automatically use it

Also ConvertTo-PodeYaml function is now implemented in C# - Powershell 5.x still uses the powershell implementation

mdaneri and others added 28 commits July 9, 2024 21:31
Added options to change the default behavior
@Badgerati
Copy link
Owner

My issue with moving PowerShell code directly into .NET, and using the PS.SDK library, is that there are many edge cases where things could break. For example, if anyone is stuck using PS6, 7, or 7.1, this will break them. Then there's the situation of somebody using PS7.4.4 and we bump the PS.SDK to 7.4.5, does this break them as well?

This is why I've always kept anything that's PowerShell specific in PowerShell, and then anything that is .NET standard, if it needs to be for performance reasons or needs a feature PowerShell fundamentally doesn't support, moved into the .NET DLL.

Is there a reason you've moved the YAML conversion into .NET? When testing originally its performance seemed alright to me, and I ran it against some large objects to convert.
If parts of it do suffer, can we extract just the parts that suffer into .NET, instead of everything?

@mdaneri
Copy link
Contributor Author

mdaneri commented Oct 12, 2024

I get it, it's frustrating. That’s why I haven’t been pushing hard on this pull request. If you check the code, you'll notice that when netstandard2.0 is the .NET version, the YAML converter isn’t compiled, so Pode falls back to using the "old" PowerShell version.

@mdaneri mdaneri marked this pull request as draft October 22, 2024 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants