Enable versions in SharePoint Library using PowerShell
$site = get-spsite("SiteURL")
foreach($web in $site.AllWebs) {
Write-Host "Inspecting " $web.Title
foreach ($list in $web.Lists) {
if($list.BaseType -eq "DocumentLibrary") {
$list.EnableVersioning = $true
$list.MajorVersionLimit = 5
$list.Update()
}
}
}
foreach($web in $site.AllWebs) {
Write-Host "Inspecting " $web.Title
foreach ($list in $web.Lists) {
if($list.BaseType -eq "DocumentLibrary") {
$list.EnableVersioning = $true
$list.MajorVersionLimit = 5
$list.Update()
}
}
}
Comments
Post a Comment