zoukankan      html  css  js  c++  java
  • sharepoint中的Power Shell命令创建、删除文档库列表

    ListTemplateType 枚举:

    自定义列表-GenericList、文档库-DocumentLibrary、图片库-PictureLibrary、公告-Announcements、联系人-Contacts、日历-Events

    pnp组件连接到SharePoint:Connect-PnpOnline -url 网站地址

    一、创建列表文档库

    1、创建一个新的列表例如:

    New-PnPList -Title Announcements(列表名称) -Template GenericList(列表类型:自定义列表GenericList、通知Announcements)

    2、创建一个标题与网址不同的列表

    New-PnPList -Title "Demo List"(列表名称) -Url "DemoList"(定义网址) -Template Announcements(列表类型)

    3、创建一个文档库列表

    New-PnPList -Title "测试文档库" -Template DocumentLibrary(文档库类型)

    4、创建一个图片库

    New-PnPList -Title "测试图片库" -Template PictureLibrary

    二、删除列表文档库

    5、删除名为“公告”的列表。要求确认

    Remove-PnPList -Identity Announcements

    6、删除名为“公告”的列表并保存到回收站,要求确认

    Remove-PnPList -Identity Announcements -Recycle

    7、删除名为“公告”的列表。不要求确认

    Remove-PnPList -Identity Announcements -Force

    三、删除列表中的项目

    8、从“演示列表”列表中删除ID为“1”的listitem

    Remove-PnPListItem -List "演示列表" -Identity "1" -Force

    9、从“演示列表”列表中删除ID为“1”的listitem,并将其保存在回收站中

    Remove-PnPListItem -List "演示列表" -Identity "1" -Force -Recycle

    更多详细内容见:

    https://docs.microsoft.com/en-us/powershell/sharepoint/overview?view=sharepoint-ps

    PowerShell在线教程

    https://www.pstips.net/powershell-online-tutorials

  • 相关阅读:
    48. Rotate Image
    83. Remove Duplicates from Sorted List
    46. Permutations
    HTML5笔记
    18. 4Sum
    24. Swap Nodes in Pairs
    42. Trapping Rain Water
    Python modf() 函数
    Python min() 函数
    Python max() 函数
  • 原文地址:https://www.cnblogs.com/xingyunqiu/p/10045838.html
Copyright © 2011-2022 走看看