PS: Fetching substring By gunnalagJune 29, 2011PowerShell A quick code to fetch the substring of a given string Code: $UserName = "TestUser009" $UserNumber = $UserName.substring($UserName.length-2) Write-Host $UserNumber Output: 09