Updating a User Profile Picture using PowerShell (Exception calling “.ctor” with “1” argument)

I needed to quickly update a User Profile photo using PowerShell and was running the following code snippet for PowerShell as a farm administrator:   $mySiteUrl = "http://mysite.mydomain.com"; $mySiteProperty = "PictureUrl"; $userAccount = "contoso\rcerda"; $userPhoto = "http://intranet.mydomain.com/sitecollectionimages/rcerda.jpg"; $mySiteHostSite = Get-SPSite $mySiteUrl $mySiteHostWeb = $mySiteHostSite.OpenWeb() $serviceContext = Get-SPServiceContext $mySiteHostSite $profileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext) $userProfile = $profileManager.GetUserProfile($userAccount)…