Raised from #902
We currently have no option to set the welcome page property of a site, therefore we should introduce a new command called --welcomePage to allow this to be set.
Whilst we do have the ability to now set arbitrary properties on a web using this command following the closure of #1202, setting the WelcomePage property is not possible as it requires an update to the RootFolder resource on the Web object not the Web object directly.
The below PowerShell example shows how this property is set via the REST API.
$headers = @{
"Authorization" = "Bearer $AccessToken"
"Accept" = "application/json;odata=verbose"
"Content-Type" = "application/json;odata=verbose"
"IF-MATCH" = "*"
"X-HTTP-METHOD" = "PATCH"
}
$body = @{
"__metadata" = @{
"type" = "SP.Folder"
}
"WelcomePage" = "SitePages/MyPage.aspx"
}
$response = Invoke-WebRequest -Method Post -Uri "https://contoso.sharepoint.com/_api/web/rootfolder" -Headers $headers -Body (ConvertTo-Json $body)
Since the folder belongs to web rather than site, shouldn't we be extending spo web set?
Absolutely, good catch @waldekmastykarz
I have amended the issue title to reflect this.
Hey @garrytrinder - do you mind If I take this up?
Seems like a challenging one than the one I had done before. But I am sure, it is worth it.. 馃憤
It's all yours @arjunumenon.
Thank you for the help 馃憤馃徎
Most helpful comment
Hey @garrytrinder - do you mind If I take this up?
Seems like a challenging one than the one I had done before. But I am sure, it is worth it.. 馃憤