|
1 | | -# {{ NAME }} |
| 1 | +# CasingStyle |
2 | 2 |
|
3 | | -{{ DESCRIPTION }} |
| 3 | +The `CasingStyle` PowerShell module provides functions for detecting, converting, and splitting different casing styles in strings. This can be |
| 4 | +useful for text transformations, standardizing variable names, and ensuring consistent formatting in scripts. |
4 | 5 |
|
5 | 6 | ## Prerequisites |
6 | 7 |
|
7 | | -This uses the following external resources: |
8 | | -- The [PSModule framework](https://github.com/PSModule) for building, testing and publishing the module. |
| 8 | +This module does not require additional dependencies, but it integrates well with the [PSModule framework](https://github.com/PSModule) for building, |
| 9 | +testing, and publishing PowerShell modules. |
9 | 10 |
|
10 | 11 | ## Installation |
11 | 12 |
|
12 | 13 | To install the module from the PowerShell Gallery, you can use the following command: |
13 | 14 |
|
14 | 15 | ```powershell |
15 | | -Install-PSResource -Name {{ NAME }} |
16 | | -Import-Module -Name {{ NAME }} |
| 16 | +Install-PSResource -Name CasingStyle |
| 17 | +Import-Module -Name CasingStyle |
17 | 18 | ``` |
18 | 19 |
|
19 | 20 | ## Usage |
20 | 21 |
|
21 | | -Here is a list of example that are typical use cases for the module. |
| 22 | +The following examples demonstrate common use cases for the module, showing how it can be applied to detect, convert, and manipulate different casing |
| 23 | +styles in strings. |
22 | 24 |
|
23 | | -### Example 1: Greet an entity |
| 25 | +### Example 1: Convert a string to a different casing style |
24 | 26 |
|
25 | | -Provide examples for typical commands that a user would like to do with the module. |
| 27 | +```powershell |
| 28 | +'thisIsCamelCase' | ConvertTo-CasingStyle -To 'snake_case' |
| 29 | +# Output: this_is_camel_case |
| 30 | +``` |
| 31 | + |
| 32 | +```powershell |
| 33 | +'thisIsCamelCase' | ConvertTo-CasingStyle -To 'UPPER_SNAKE_CASE' |
| 34 | +# Output: THIS_IS_CAMEL_CASE |
| 35 | +``` |
| 36 | + |
| 37 | +```powershell |
| 38 | +'thisIsCamelCase' | ConvertTo-CasingStyle -To 'kebab-case' |
| 39 | +# Output: this-is-camel-case |
| 40 | +``` |
| 41 | + |
| 42 | +### Example 2: Detect the casing style of a string |
| 43 | + |
| 44 | +```powershell |
| 45 | +'testTestTest' | Get-CasingStyle |
| 46 | +# Output: camelCase |
| 47 | +``` |
26 | 48 |
|
27 | 49 | ```powershell |
28 | | -Greet-Entity -Name 'World' |
29 | | -Hello, World! |
| 50 | +'TestTestTest' | Get-CasingStyle |
| 51 | +# Output: PascalCase |
30 | 52 | ``` |
31 | 53 |
|
32 | | -### Example 2 |
| 54 | +### Example 3: Split a string based on casing style |
33 | 55 |
|
34 | | -Provide examples for typical commands that a user would like to do with the module. |
| 56 | +```powershell |
| 57 | +Split-CasingStyle -Text 'this-is-a-kebab-case-string' -By 'kebab-case' |
| 58 | +# Output: |
| 59 | +# this |
| 60 | +# is |
| 61 | +# a |
| 62 | +# kebab |
| 63 | +# case |
| 64 | +# string |
| 65 | +``` |
35 | 66 |
|
36 | 67 | ```powershell |
37 | | -Import-Module -Name PSModuleTemplate |
| 68 | +Split-CasingStyle -Text 'ThisIsAPascalCaseString' -By 'PascalCase' |
| 69 | +# Output: |
| 70 | +# This |
| 71 | +# Is |
| 72 | +# A |
| 73 | +# Pascal |
| 74 | +# Case |
| 75 | +# String |
38 | 76 | ``` |
39 | 77 |
|
40 | 78 | ### Find more examples |
41 | 79 |
|
42 | 80 | To find more examples of how to use the module, please refer to the [examples](examples) folder. |
43 | 81 |
|
44 | | -Alternatively, you can use the Get-Command -Module 'This module' to find more commands that are available in the module. |
45 | | -To find examples of each of the commands you can use Get-Help -Examples 'CommandName'. |
| 82 | +Alternatively, you can use the following PowerShell commands: |
| 83 | + |
| 84 | +```powershell |
| 85 | +Get-Command -Module 'CasingStyle' |
| 86 | +``` |
| 87 | + |
| 88 | +To find examples of each of the commands, you can use: |
| 89 | + |
| 90 | +```powershell |
| 91 | +Get-Help ConvertTo-CasingStyle -Examples |
| 92 | +``` |
46 | 93 |
|
47 | 94 | ## Documentation |
48 | 95 |
|
49 | | -Link to further documentation if available, or describe where in the repository users can find more detailed documentation about |
50 | | -the module's functions and features. |
| 96 | +For further documentation, please visit the official documentation pages for each function: |
| 97 | + |
| 98 | +- [ConvertTo-CasingStyle](https://psmodule.io/Casing/Functions/ConvertTo-CasingStyle/) |
| 99 | +- [Get-CasingStyle](https://psmodule.io/Casing/Functions/Get-CasingStyle/) |
| 100 | +- [Split-CasingStyle](https://psmodule.io/Casing/Functions/Split-CasingStyle/) |
51 | 101 |
|
52 | 102 | ## Contributing |
53 | 103 |
|
54 | | -Coder or not, you can contribute to the project! We welcome all contributions. |
| 104 | +Regardless of your experience level, your contributions are valuable! Whether you're a beginner or an expert, you can help improve this project by |
| 105 | +sharing feedback, reporting issues, or contributing code. |
55 | 106 |
|
56 | 107 | ### For Users |
57 | 108 |
|
58 | | -If you don't code, you still sit on valuable information that can make this project even better. If you experience that the |
59 | | -product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests. |
60 | | -Please see the issues tab on this project and submit a new issue that matches your needs. |
| 109 | +If you encounter unexpected behavior, errors, or missing functionality, you can help by submitting bug reports and feature requests. |
| 110 | +Please see the issues tab on this project and submit a new issue that describes your experience. |
61 | 111 |
|
62 | 112 | ### For Developers |
63 | 113 |
|
64 | | -If you do code, we'd love to have your contributions. Please read the [Contribution guidelines](CONTRIBUTING.md) for more information. |
| 114 | +If you write code, we'd love to have your contributions! Please read the [Contribution guidelines](CONTRIBUTING.md) for more information. |
65 | 115 | 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. |
66 | | - |
67 | | -## Acknowledgements |
68 | | - |
69 | | -Here is a list of people and projects that helped this project in some way. |
|
0 commit comments