Tip: You can convert some text to title case (the first letter in upper case and the following letters in lower case).
Single item
1 2 |
$text = [System.Threading.Thread]::CurrentThread.CurrentCulture.TextInfo $text.ToTitleCase('test') |
Multiple items
1 2 |
$text = [System.Threading.Thread]::CurrentThread.CurrentCulture.TextInfo Get-ChildItem -Path C:\Demo -Filter *.txt | Rename-Item -NewName {"$($text.ToTitleCase($_.BaseName.ToLower()))$($_.Extension)"} |