PowerShell Get Value of a Hyperlink Field in SharePoint

I needed to get the hyperlink value from a field in a SharePoint List.

Here is how you do it.

$web = get-spweb http://sharepointed.com/sites/YourSite
$list = $web.Lists["Your List Name"]

foreach($i in $list.items)
	{
		$ofldurl= new-object Microsoft.SharePoint.SPFieldUrlValue($i["MyHyperlinkField"])
		write-host $ofldurl.URL 
                write-host $ofldurl.Description
	}
$web.Dispose()

Leave a Reply

Your email address will not be published. Required fields are marked *