Here is simple code example to get you started:
Add-PSSnapin Microsoft.SharePoint.PowerShell
$siteUrl = "http://mycoolsite/"
$accountName = "MyAccountName"
$site = Get-SPSite $siteUrl
$context = Get-SPServiceContext($site)
$pm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
# If user profile doesn't exist create new one
if ($pm.UserExists($accountName)) {
$userProfile = $pm.GetUserProfile($accountName)
} else {
$userProfile = $pm.CreateUserProfile($accountName)
}
# Update user profile properties
$userProfile["FirstName"].Value = "Bill"
$userProfile["LastName"].Value = "Gates"
# Commit changes
$userProfile.Commit()
And here you have example on how to list all local users (I didn't tested it!):