Skip to content

Instantly share code, notes, and snippets.

@bilz346
Created October 6, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bilz346/9c3b90c6b0cc26aa36af to your computer and use it in GitHub Desktop.
Save bilz346/9c3b90c6b0cc26aa36af to your computer and use it in GitHub Desktop.
Format-Word
Function Format-Word
{
[CmdletBinding()]
Param([parameter(Mandatory=$True,ValueFromPipeline=$True)] [String]$String)
Process
{
ForEach ($Word in $String.split())
{
$First = [string]$Word[0]
$Rest = $Word.TrimStart($First)
$FormattedWord += "$($First.ToUpper() + $Rest.ToLower()) "
}
$FormattedWord
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment