-
Notifications
You must be signed in to change notification settings - Fork 457
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
[Feature Request]: Code optimization - retrieve module relative path through dedicated function #3187
Comments
Should link to $moduleRelative = $moduleRoot.Replace('\', '/').split('modules/')[1]
$splitHyphens = $moduleRelative.split('-')
$splitHyphens = $splitHyphens | ForEach-Object { $_.substring(0, 1).toupper() + $_.substring(1) }
$splitHyphens = $splitHyphens -join ''
$fullModuleIdentifier = 'Microsoft.{0}' -f $splitHyphens.Replace('-', '') |
@AlexanderSehr so I get the function should return the module full resourceType and not only the relative path, correct? If so I guess we should go with something like |
Should also include an update to custom modules to include their suffix in the readme title
|
Correct. So |
Ref updated Set-DeploymentExamplesSection in Set-ModuleReadme for cleaner code to convert from kebab-case to camelCase or PascalCase: # Convert moduleName from kebab-case to camelCase
$First, $Rest = $moduleName -Split '-',2
$moduleNameCamelCase = $First.Tolower() + (Get-Culture).TextInfo.ToTitleCase($Rest) -Replace '-'
# Convert moduleName from kebab-case to PascalCase
$moduleNamePascalCase = (Get-Culture).TextInfo.ToTitleCase($moduleName) -Replace '-' |
Description
Implement helper function to retrieve the module relative path given the full path, e.g.,
Get-FormattedModuleRelativePath
Replace lines like
used e.g., by Pester test, with a call to that function
The text was updated successfully, but these errors were encountered: