Enable List Item Version History using Powershell

  1. Add-PSSnapin Microsoft.SharePoint.PowerShell   
  2. $webURL = Read-Host "Please enter your SiteCollection Url"  
  3. $spSite = New-Object Microsoft.SharePoint.SPSite($webURL)  
  4. $web = $spSite.OpenWeb()  
  5.   
  6.   
  7. $list = $web.Lists["Customer"]  
  8. Write-Host “Enabling list version history' for:- ” $list.Title -ForegroundColor Yellow  
  9. $list.EnableVersioning = $true  
  10. $list.Update()  
  11.   
  12.   
  13. Write-Host “Enable Versioning completed successfully” -ForegroundColor Green  
  14.   
  15. $web.Dispose()  
  16. Remove-PSSnapin Microsoft.SharePoint.PowerShell