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()

 

About the author 

Sarah Safari