I am try to set document set welcome page view with powershell csom with out any luck. Does anyone have an idea how to do it
$password=""
$username=""
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Import-Module Sharegate
$siteUrl = "https://sharepoint.com/sites/projects/"
write-host "Connecting to SharePoint "$siteUrl
$pwd = convertto-securestring $password -asplaintext -force
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $pwd)
$ctx.Credentials = $credentials
$web=$ctx.web;
$ctx.Load($web)
$ctx.ExecuteQuery()
write-host $web.title
$list = $web.Lists.GetByTitle("Documents")
$contentypee=$list.ContentTypes
$ctx.Load($contentypee)
$ctx.Load($list)
$ctx.ExecuteQuery()
Foreach($ct in $contentypee){
if($ct.name -eq 'Record'){
$ctrecord=$ct;
Write-Host "list title" $list.title
Write-Host "contenttype name is " $ctrecord.Name
Write-Host "content type id " $ctrecord.ID
}
}
$ctrecord1=$contentypee.GetById($ctrecord.ID)
$ctx.Load($ctrecord1)
$ctx.ExecuteQuery()