Provide some generic helpers functions for Powershell.
Slugify a String in entry
ConvertTo-Slug [-Text] <String> [[-Delimiter] <String>] [-CapitalizeFirstLetter] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Text | String. Text to slugify | true | true (ByValue) | ||
Delimiter | String. Optional, the delimiter used. If omitted, "-" will be used | false | false | - | |
CapitalizeFirstLetter | Switch. If the switch is set, it will capitalize the first letter of each word in the "Text" string. | false | false | False |
EXAMPLE 1
ConvertTo-Slug "That's all folks!"
Will return "thats-all-folks"
EXAMPLE 2
ConvertTo-Slug "That's all Folks!" -Delimiter "_"
Will return "thats_all_folks"
EXAMPLE 3
ConvertTo-Slug "That's all Folks!" -Delimiter "" -CapitalizeFirstLetter
Will return "ThatsAllFolks"