I’ve decided to add an updated post regarding working with the UPS using powershell since I’ve learned a few things since then.

Connecting to the Profile Manager

I’ve seen a couple ways to connect to the profile manager, but the most elegant so far has been: http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/12/use-powershell-to-edit-sharepoint-profiles.aspx
The code from the URL above is shown below. I really like what this person came up with since it uses the get-spsite cmdlet and works universally on any farm.
$Site = Get-SPSite -Limit 1    #Get Site for Service context
$ServiceContext = Get-SPServiceContext($Site)
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
$Profiles = $ProfileManager.GetEnumerator()    #Load all profiles into array
Everything following this builds off this code segment.

Listing Properties

This will actually just return the properties for the current user, but thats fine since we just want a list of property names to work with.
$profiles.current.Properties | select Name,DisplayName
For the sake of space I won’t show the results, but it will include things like WorkEmail, PictureURL, and PersonalSpace to name a few examples.

Updating Properties

First off i’d only recommend doing this if there is a GOOD reason. If something goes south with the code you use (like updating the wrong property), bad things can happen to your user profiles. So always preform things like this on a test system. (and do backups). Also some properties should not be updated outside of the internal UPS processes. Just use common sense when updating profile properties.
Foreach ($profile in $profiles) {
     $profile[“WorkEmail”].Value = “somenewvalue”
     $profile.Commit()
}
The above example, if run, would actually set every users work email to the value on the right side of the = sign. This isn’t something you would probably want to do but it does show how easily you can update values. For example, with a little conditional logic, you could update Office or the PictureURL.

Putting it together in a full script

Since the Listing Properties section is just for figuring out what properties exist, it wouldn’t be used in a production script.
$Site = Get-SPSite -Limit 1    #Get Site for Service context
$ServiceContext = Get-SPServiceContext($Site)
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
$Profiles = $ProfileManager.GetEnumerator()    #Load all profiles into array
Foreach ($profile in $profiles) {
     $profile[“PictureURL”].Value = “somenewvalue”
     $profile.Commit()
}

Updating a single user

The above is good for mass updates but there is always the possibility you would want to update a single user. If would just require a small modification to the foreach statement. I’d recommend running the code without any assignments or commits to make sure it returns the correct person.
Foreach ($profile in $profiles) {
If ($profile[“accountname”].value -eq “domain\username”) {
$profile[“pictureURL”].value = “http:\\somesite\somepic.jpg
                $profile.Commit()
}
}