This gets all of the users in the User Profile service store
#Get Site for Service context
$Site = Get-SPSite -Limit 1
$ServiceContext = Get-SPServiceContext($Site)
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
#$profiles = $ProfileManager.GetEnumerator() #Load all profiles into array
$cnt = 0
foreach($usrProfile in $profileManager.GetEnumerator()) {
$cnt += 1
Write-Host $usrProfile.AccountName "|" $usrProfile.DisplayName;
}
write-host "Total users in the User Profile: $cnt"