Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
share|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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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