Skip to content

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