So, I am trying to get a picture from a picture library into that user's profile in SharePoint using PowerShell. I've successfully gotten the picture into the PictureURL value but I don't think it's working properly. For one, the picture maintains it's original size (as seen here). I want SharePoint to go through the process of making the three images (small, medium, and large). Is there a way to perform this operation using PowerShell? Here is my current PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$mySiteUrl = "http://mysiteurl"
$site = Get-SPSite $mySiteUrl
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$profile = $profileManager.GetUserProfile("ADTestUser")
$profile["PictureURL"].Value = "http://mypictureurl/ADTestUser.jpg"
$profile.Commit()
$site.Dispose()
Update-SPProfilePhotoStore -MySiteHostLocation $mySiteUrl -CreateThumbnailsForImportedPhotos 1