Powershell
PowerShell – ProperCase Function
Change any case to Proper Case (‘ITNOTES DoT net’ to ‘Itnotes Dot Net’):
This is very useful for us during scripted user creations when the usernames and such from the source were in random cases. This script could also be useful with auto user provisioning with ILM from another datasource, we currently us a VBScript that is much longer.
This script basically converts everything to lowercase the capitalizes the first letter of each word.
function ToProperCase ([String]$in) { $in = $in.Tolower() $textInfo = [System.Threading.Thread]::CurrentThread.CurrentCulture.TextInfo return $textInfo.ToTitleCase($in) } |
Example of use
$Title = "ITNOTE DOT NET" $Title = ToProperCase($Title) |
Returns:
Itnotes Dot Net
Complete Script
function ToProperCase ([String]$in) { $in = $in.Tolower() $textInfo = [System.Threading.Thread]::CurrentThread.CurrentCulture.TextInfo return $textInfo.ToTitleCase($in) $Title = "ITNOTE DOT NET" $Title = ToProperCase($Title) |
PowerShell 2.0 Release Candidate for Windows XP SP3 and Server 2003 SP2
Finally we see a release candidate for Windows XP, but you must have SP3 installed.
Download here: https://connect.microsoft.com/windowsmanagement/Downloads
