2014-12-17

Sometimes it is essential to hide a column in a SharePoint list/library. It can be done easily with PowerShell. The following code hide “fieldName” in Edit and New Forms; however, it is available in display and new form!

#Get the Web
$web = Get-SPWeb "URL"
#Get the List
$List = $Web.Lists["listName"]
#Get the Field 
$Field = $List.Fields["fieldName"]
$Field.ShowInEditForm = $false
$Field.ShowInNewForm = $false
$Field.ShowInDisplayForm = $true
$Field.ShowInViewForms = $true
$Field.Update()
$web.Update()
$web.Dispose()

 

(Visited 155 times, 1 visits today)

About the author 

Sarah Safari

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 7$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos in the Collab365 Academy. This offer is insane and is only available for a limited period.