I am trying to set a URL Field to update the Description and every time i run this ClientSide (via Powershell) I get the following error

Exception calling "ExecuteQuery" with "0" argument(s): "Invalid URL: Microsoft.SharePoint.Client.FieldUrlValue

Basically what I'm trying to do is to set the URL to a Folder in a Document Library for a Specific User

The List will show

Users Name



Document Library URL

Currently it shows it all correctly however its not that nice to see a huge URL in the Document Library URL field hence I want to Update it to show the Description which should show "User's Documents"

Easy done on Server Side and I have it Working on Server Side - However I would like to set this Client Side

So an example is





$url = $item["Document_x0020_Url"].url
$ofldurl= new-object Microsoft.SharePoint.Client.FieldUrlValue
$ofldurl.URL = $url
$ofldurl.Description = $item["Title"]+"'s"+" "+"Documents"
$item["Document_x0020_Url"] = $ofldurl

I have double Checked and the URL is Set correctly in the Class (or at least it seems it to me) below is the output from the FieldURLValue Variable I had Created




Ryan's Documents                                        



Can Anyone see why this is not working at all or is this just me having a bad day?


I've analyzed the requests sent by your PowerShell snippet and an equivalent version sent by "native" managed client object modell by Fiddler. As far as I see, the difference is caused by the way PS handles (casts) objects in the background.

I found, that this version does what you need:

ofldurl= New-Object Microsoft.SharePoint.Client.FieldUrlValue
$url = $item["Document_x0020_Url"].Url
$ofldurl.Description = $item["Title"]+"'s"+" "+"Documents"
$ofldurl.Url = $url
$item["Document_x0020_Url"] = [Microsoft.SharePoint.Client.FieldUrlValue]$ofldurl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.