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

ConvertTo-PodeWebPage - add grouping parameters #351

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

EreminDV
Copy link

@EreminDV EreminDV commented Sep 6, 2022

Description of the Change

  • add parameter 'Group' to 'ConvertTo-PodeWebPage' (as it defined in 'Add-PodeWebPage'), allow to group generated pages by passed key.
  • add parameter 'GroupModule' to 'ConvertTo-PodeWebPage', allow to group pages by module name.

Related Issue

no, its enhancement

Examples

ConvertTo-PodeWebPage -Module 'Custom.ADHelpers' -Group 'AD Tools'
ConvertTo-PodeWebPage -Module 'DBUtils' -GroupModule

Additional Context

In general, I want to add missing parameter ("group") to 'ConvertTo-PodeWebPage' cmdlet.

add parameter 'Group' to 'ConvertTo-PodeWebPage' as it defined in 'Add-PodeWebPage', group pages by passed key.
add parameter 'GroupModule' to 'ConvertTo-PodeWebPage' -- group pages by module name.
ConvertTo-PodeWebPage - add grouping parameters
}

'GroupByVerbs' {
$group = [string]::Empty
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe to remove this line :)

switch ($PSCmdlet.ParameterSetName) {
'NoGrouping' {
$group = [string]::Empty
break
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breaks aren't really needed in this switch statement, since only a single value is being supplied to the switch and not an array.

}

'GroupByCustomKey' {
$group = $Group -replace "\.",""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why you were replacing the dots, but I'm guessing it's because it stops the groups expanding? This looks like the same issue as with spaces.

This line here:

return ($Value -replace '\s', '_')

Changing \s to [\s\.] should fix this issue, and mean we can remove these two replace '\.' parts here :)

@Badgerati Badgerati added the enhancement ⬆️ New feature or request label Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ⬆️ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants