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
link|improve this question
I've found the answer: the url stored like a simple string with url, description divided by comma. – lecter 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
1  
Actually then I wrote comment before reading Mark's answer. But it's really right answer. Marked it. – lecter Aug 24 '11 at 4:27
feedback

1 Answer

up vote 1 down vote accepted

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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