First things first, are you familiar with
delprof? I would not remove profiles with a script, unless that script automated delprof. I don't like reinventing the wheel.... Plenty of new problems to solve.
Having said that, you can accomplish what you're after like so;
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'|
Where-object{$_.PSChildName.length -gt 8} |
Get-ItemProperty -Name CentralProfile
Hope that helps,
~Glenn