Skip to content

Instantly share code, notes, and snippets.


sysmadmin/Set-Capitalization Secret

Last active Sep 25, 2015
What would you like to do?
Capitalizing First Letters Only
Function Set-Capitalization {
Displays submitted text with only the first letter of each word capitalized
Set-Capitalization takes the text given to its Text parameter (either through the pipeline or directly) and capitalizes the first letter of each word while making the rest of the word lower case.
Accepts a string
"HelLo, thIs IS a Bad SentenCE." | Set-Capitalization
This will take the sentence above and output: "Hello, This Is A Bad Sentence"
Set-Capitalization "ANOTHER bad SENTENCE for TESTING"
This will output "Another Bad Sentence For Testing"
$Text = $Text.ToLower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment