【发布时间】:2016-07-05 01:54:54
【问题描述】:
我正在开发一个 PowerShell 脚本,这个脚本应该执行以下任务:
- 创建文档库(例如金融文档)
- 将内容类型附加到此文档库
- 将此内容类型设置为默认内容类型
我被困在第三点,无法使用 PowerShell 设置默认内容类型。这是我用来更新内容类型的代码:
代码
$ctidary = New-Object System.Collections.Generic.List[Microsoft.SharePoint.Client.ContentTypeId]
$ctidary.insert($ctID)
$list.rootfolder.uniquecontenttypeorder = $ctidary
$list.rootfolder.update()
$clientContext.executeQuery()
错误
Cannot find an overload for "insert" and the argument count: "1"
请建议我如何使用 Powershell 脚本将内容类型设置为 SharePoint Online 中文档库的默认内容类型。
提前致谢!
【问题讨论】:
标签: powershell sharepoint office365 sharepoint-online