The CasingStyle
PowerShell module provides functions for detecting, converting, and splitting different casing styles in strings. This can be
useful for text transformations, standardizing variable names, and ensuring consistent formatting in scripts.
This module does not require additional dependencies, but it integrates well with the PSModule framework for building, testing, and publishing PowerShell modules.
To install the module from the PowerShell Gallery, you can use the following command:
Install-PSResource -Name CasingStyle
Import-Module -Name CasingStyle
The following examples demonstrate common use cases for the module, showing how it can be applied to detect, convert, and manipulate different casing styles in strings.
'thisIsCamelCase' | ConvertTo-CasingStyle -To 'snake_case'
# Output: this_is_camel_case
'thisIsCamelCase' | ConvertTo-CasingStyle -To 'UPPER_SNAKE_CASE'
# Output: THIS_IS_CAMEL_CASE
'thisIsCamelCase' | ConvertTo-CasingStyle -To 'kebab-case'
# Output: this-is-camel-case
'testTestTest' | Get-CasingStyle
# Output: camelCase
'TestTestTest' | Get-CasingStyle
# Output: PascalCase
Split-CasingStyle -Text 'this-is-a-kebab-case-string' -By 'kebab-case'
# Output:
# this
# is
# a
# kebab
# case
# string
Split-CasingStyle -Text 'ThisIsAPascalCaseString' -By 'PascalCase'
# Output:
# This
# Is
# A
# Pascal
# Case
# String
To find more examples of how to use the module, please refer to the examples folder.
Alternatively, you can use the following PowerShell commands:
Get-Command -Module 'CasingStyle'
To find examples of each of the commands, you can use:
Get-Help ConvertTo-CasingStyle -Examples
For further documentation, please visit the official documentation pages for each function:
Regardless of your experience level, your contributions are valuable! Whether you're a beginner or an expert, you can help improve this project by sharing feedback, reporting issues, or contributing code.
If you encounter unexpected behavior, errors, or missing functionality, you can help by submitting bug reports and feature requests. Please see the issues tab on this project and submit a new issue that describes your experience.
If you write code, we'd love to have your contributions! Please read the Contribution guidelines for more information. You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement.