magritton
5/8/2020 - 1:57 PM

PS SP Field Link to Item

This changes the link to item hyperlink on a SharePoint List field. Also changes the context menu field. Need to remember that some fields are Title_LinkToList and must be changed in the view.

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

cls

#Set Configuration Parameters
$WebURL = "https://xxxx"
$ListName = "Incoming Report"
$FieldName="Component Description" #Display Name of the Field
#$FieldName="SWI"

#Get the Web, List, Item and User objects
$Web= Get-SPWeb $WebURL
$List= $web.Lists[$ListName]
  
#Get the column from List
$Field = $List.Fields[$FieldName]
 
#Update Field Settings
#$Field.ListItemMenu = $False
#$Field.ListItemMenuAllowed = "Allowed"
$Field.LinkToItemAllowed = "Allowed" #Allowed or Required, Require put it in Allowed is the default
$Field.LinkToItem = $false
$Field.Update()
$List.Update()