How do I change both the URL and description of a "Link" field using a Powershell script?

In the past I've used the following:

$newitem = $splist.Items.Add()
$newitem["Title"] = $somestuff
  • I've found the answer: the url stored like a simple string with url, description divided by comma. – Mikhail Blinnikov Aug 23 '11 at 5:54
  • I think Mike beat you to it. Please mark his answer as solution – Anders Rask Aug 23 '11 at 6:18

Extending your example above:

$newitem = $splist.Items.Add()
$somestuff = "http://www.google.com, Google"
$newitem["Link"] = $somestuff

That will, assuming "Link" is a type of "Hyperlink or Picture" (Hyperlink), create a link that says Google and links to http://www.google.com

| improve this answer | |

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.