Hi all,
I am trying to set Document Set's Welcome page view dropdown with my custom view via Powershell. However, below code seems be not working. Anybody have any workaround? $xmldoc.Contains("WelcomePageView")) xmldoc object do not contain "WelcomePageview".
function SetWelcomePageView() { $contenttype=$lib.ContentTypes["DocumentIT"] $viewid = $lib.Views["zzzDocSetView"].Id $xmldocs = $contenttype.XmlDocuments Write-Host $xmldocs foreach($xmldoc in $xmldocs) { if($xmldoc.Contains("WelcomePageView")) { Write-Host "XML contains WPV" $newview = [XML] @" <wpv:WelcomePageView xmlns:wpv="http://schemas.microsoft.com/office/documentsets/welcomepageview" ViewId="$viewid" /> "@ $xmldocs.Delete("http://schemas.microsoft.com/office/documentsets/welcomepageview") $xmldocs.Add($newview) break; } } $contenttype.Update($updateChildren, $false) Write-Host "Welcome Page View updated at " $list.Title }