powershell Powershell函数用于在库中的SharePoint中创建文件夹和子文件夹

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell Powershell函数用于在库中的SharePoint中创建文件夹和子文件夹相关的知识,希望对你有一定的参考价值。

$webUrl = "http://portal.opwftg.com/sites/OPWSS/Teams/Safety/SiteTemplate/IncidentReports"
$listName = "First AID"

### Get web and list
$web = Get-SPWeb $webUrl
$list = $web.Lists[$listName]

$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"2014")
$folder["Title"] = "2014"
$folder.Update();

$s1folder = $list.AddItem($folder.Folder.ServerRelativeUrl, 
[Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"01-Jan")
$s1folder["Title"] = "Jan"
$s1folder.Update();
$webUrl = "http://portal.opwftg.com/sites/OPWSS/Testing"
$listName = "DocSetTest"

### Get web and list
$web = Get-SPWeb $webUrl
$list = $web.Lists[$listName]

$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"01 - Project Documents")
$folder["Title"] = "01 - Project Documents"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Project Charter")
$folder["Title"] = "A - Project Charter"
$folder.Update();
$webUrl = "http://portal.opwftg.com/sites/OPWSS/Testing"
$listName = "DocSetTest"

### Get web and list
$web = Get-SPWeb $webUrl
$list = $web.Lists[$listName]

$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"01 - Project Documents")
$folder["Title"] = "01 - Project Documents"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Project Charter")
$folder["Title"] = "A - Project Charter"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/A - Project Charter/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A.01 - Stakeholder Register")
$folder["Title"] = "A.01 - Stakeholder Register"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Project Plan")
$folder["Title"] = "B - Project Plan"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/B - Project Plan/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B.01 - Milestone Chart")
$folder["Title"] = "B.01 - Milestone Chart"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - Roles and Responsibilities")
$folder["Title"] = "C - Roles and Responsibilities"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/C - Roles and Responsibilities/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C.01 - RACI Matrix")
$folder["Title"] = "C.01 - RACI Matrix"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D - Time and Expenses")
$folder["Title"] = "D - Time and Expenses"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/D - Time and Expenses/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D.01 - Time and Labor")
$folder["Title"] = "D.01 - Time and Labor"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/D - Time and Expenses/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D.02 - Project Expenses")
$folder["Title"] = "D.02 - Project Expenses"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"E - In-Flight Assessment")
$folder["Title"] = "E - In-Flight Assessment"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/E - In-Flight Assessment/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"E.01 - Assessment Checklist")
$folder["Title"] = "E.01 - Assessment Checklist"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F - Sign-off Documents")
$folder["Title"] = "F - Sign-off Documents"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.01 - Business Process Sign-off")
$folder["Title"] = "F.01 - Business Process Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.02 - Business Requirement Sign-off")
$folder["Title"] = "F.02 - Business Requirement Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.03 - Technical Design Sign-off")
$folder["Title"] = "F.03 - Technical Design Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.04 - Test Scenario Sign-off")
$folder["Title"] = "F.04 - Test Scenario Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.05 - CRP1 Sign-off")
$folder["Title"] = "F.05 - CRP1 Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.06 - CRP2 Sign-off")
$folder["Title"] = "F.06 - CRP2 Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.07 - UAT Sign-off")
$folder["Title"] = "F.07 - UAT Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.08 - Cut Over Sign-off")
$folder["Title"] = "F.08 - Cut Over Sign-off"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"G - Statement of Work (SOW)")
$folder["Title"] = "G - Statement of Work (SOW)"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"H - On-boarding Information")
$folder["Title"] = "H - On-boarding Information"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"I - Segregation of Duties (SOD)")
$folder["Title"] = "I - Segregation of Duties (SOD)"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"J - Project Team Contacts")
$folder["Title"] = "J - Project Team Contacts"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"02 - Business Processes")
$folder["Title"] = "02 - Business Processes"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"03 - Business Requirements")
$folder["Title"] = "03 - Business Requirements"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"04 - Change Management")
$folder["Title"] = "04 - Change Management"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"05 - Technical Designs")
$folder["Title"] = "05 - Technical Designs"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"06 - Development")
$folder["Title"] = "06 - Development"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"07 - Test Scenarios and Scripts")
$folder["Title"] = "07 - Test Scenarios and Scripts"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"08 - Traceability Matrix")
$folder["Title"] = "08 - Traceability Matrix"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"09 - Testing")
$folder["Title"] = "09 - Testing"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Conference Room Pilot (CRP1)")
$folder["Title"] = "A - Conference Room Pilot (CRP1)"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Conference Room Pilot (CRP2)")
$folder["Title"] = "B - Conference Room Pilot (CRP2)"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - User Acceptance Test (UAT)")
$folder["Title"] = "C - User Acceptance Test (UAT)"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"10 - Risks")
$folder["Title"] = "10 - Risks"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Risk Register")
$folder["Title"] = "A - Risk Register"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Risk Ratings Impact")
$folder["Title"] = "B - Risk Ratings Impact"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - Risk Evaluation Grid")
$folder["Title"] = "C - Risk Evaluation Grid"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"11 - Issues")
$folder["Title"] = "11 - Issues"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"12 - Status Reports")
$folder["Title"] = "12 - Status Reports"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"13 - Lessons Learned")
$folder["Title"] = "13 - Lessons Learned"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"14 - Templates")
$folder["Title"] = "14 - Templates"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/14 - Templates/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Standard and Guidelines")
$folder["Title"] = "A - Standard and Guidelines"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/14 - Templates/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Project Templates (OUM)")
$folder["Title"] = "B - Project Templates (OUM)"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"15 - Cut Over Plans")
$folder["Title"] = "15 - Cut Over Plans"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"16 - Post Go-Live")
$folder["Title"] = "16 - Post Go-Live"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/16 - Post Go-Live/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Solution Operational Needs")
$folder["Title"] = "A - Solution Operational Needs"
$folder.Update();
 
$folder = $list.AddItem("DocSetTest/16 - Post Go-Live/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Design, Support and Operations")
$folder["Title"] = "B - Design, Support and Operations"
$folder.Update();
 
$webUrl = "https://dover.sharepoint.com/sites/DoverFluids/IT"
$listName = "FluidProjects"

### Get web and list
$web = Get-SPWeb $webUrl
$list = $web.Lists[$listName]
$relativeListName = $listName + '/'

$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"01 - Project Documents")
$folder["Title"] = "01 - Project Documents"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Project Charter")
$folder["Title"] = "A - Project Charter"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/A - Project Charter/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A.01 - Stakeholder Register")
$folder["Title"] = "A.01 - Stakeholder Register"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Project Plan")
$folder["Title"] = "B - Project Plan"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/B - Project Plan/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B.01 - Milestone Chart")
$folder["Title"] = "B.01 - Milestone Chart"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - Roles and Responsibilities")
$folder["Title"] = "C - Roles and Responsibilities"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/C - Roles and Responsibilities/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C.01 - RACI Matrix")
$folder["Title"] = "C.01 - RACI Matrix"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D - Time and Expenses")
$folder["Title"] = "D - Time and Expenses"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/D - Time and Expenses/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D.01 - Time and Labor")
$folder["Title"] = "D.01 - Time and Labor"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/D - Time and Expenses/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"D.02 - Project Expenses")
$folder["Title"] = "D.02 - Project Expenses"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"E - In-Flight Assessment")
$folder["Title"] = "E - In-Flight Assessment"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/E - In-Flight Assessment/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"E.01 - Assessment Checklist")
$folder["Title"] = "E.01 - Assessment Checklist"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F - Sign-off Documents")
$folder["Title"] = "F - Sign-off Documents"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.01 - Business Process Sign-off")
$folder["Title"] = "F.01 - Business Process Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.02 - Business Requirement Sign-off")
$folder["Title"] = "F.02 - Business Requirement Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.03 - Technical Design Sign-off")
$folder["Title"] = "F.03 - Technical Design Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.04 - Test Scenario Sign-off")
$folder["Title"] = "F.04 - Test Scenario Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.05 - CRP1 Sign-off")
$folder["Title"] = "F.05 - CRP1 Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.06 - CRP2 Sign-off")
$folder["Title"] = "F.06 - CRP2 Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.07 - UAT Sign-off")
$folder["Title"] = "F.07 - UAT Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/F - Sign-off Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"F.08 - Cut Over Sign-off")
$folder["Title"] = "F.08 - Cut Over Sign-off"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"G - Statement of Work (SOW)")
$folder["Title"] = "G - Statement of Work (SOW)"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"H - On-boarding Information")
$folder["Title"] = "H - On-boarding Information"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"I - Segregation of Duties (SOD)")
$folder["Title"] = "I - Segregation of Duties (SOD)"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "01 - Project Documents/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"J - Project Team Contacts")
$folder["Title"] = "J - Project Team Contacts"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"02 - Business Processes")
$folder["Title"] = "02 - Business Processes"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"03 - Business Requirements")
$folder["Title"] = "03 - Business Requirements"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"04 - Change Management")
$folder["Title"] = "04 - Change Management"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"05 - Technical Designs")
$folder["Title"] = "05 - Technical Designs"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"06 - Development")
$folder["Title"] = "06 - Development"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"07 - Test Scenarios and Scripts")
$folder["Title"] = "07 - Test Scenarios and Scripts"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"08 - Traceability Matrix")
$folder["Title"] = "08 - Traceability Matrix"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"09 - Testing")
$folder["Title"] = "09 - Testing"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Conference Room Pilot (CRP1)")
$folder["Title"] = "A - Conference Room Pilot (CRP1)"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Conference Room Pilot (CRP2)")
$folder["Title"] = "B - Conference Room Pilot (CRP2)"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "09 - Testing/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - User Acceptance Test (UAT)")
$folder["Title"] = "C - User Acceptance Test (UAT)"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"10 - Risks")
$folder["Title"] = "10 - Risks"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Risk Register")
$folder["Title"] = "A - Risk Register"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Risk Ratings Impact")
$folder["Title"] = "B - Risk Ratings Impact"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "10 - Risks/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"C - Risk Evaluation Grid")
$folder["Title"] = "C - Risk Evaluation Grid"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"11 - Issues")
$folder["Title"] = "11 - Issues"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"12 - Status Reports")
$folder["Title"] = "12 - Status Reports"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"13 - Lessons Learned")
$folder["Title"] = "13 - Lessons Learned"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"14 - Templates")
$folder["Title"] = "14 - Templates"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "14 - Templates/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Standard and Guidelines")
$folder["Title"] = "A - Standard and Guidelines"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "14 - Templates/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Project Templates (OUM)")
$folder["Title"] = "B - Project Templates (OUM)"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"15 - Cut Over Plans")
$folder["Title"] = "15 - Cut Over Plans"
$folder.Update();
 
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"16 - Post Go-Live")
$folder["Title"] = "16 - Post Go-Live"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "16 - Post Go-Live/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"A - Solution Operational Needs")
$folder["Title"] = "A - Solution Operational Needs"
$folder.Update();
 
$folder = $list.AddItem($relativeListName + "16 - Post Go-Live/", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"B - Design, Support and Operations")
$folder["Title"] = "B - Design, Support and Operations"
$folder.Update();
 

以上是关于powershell Powershell函数用于在库中的SharePoint中创建文件夹和子文件夹的主要内容,如果未能解决你的问题,请参考以下文章

powershell Powershell函数用于计算目录中所有文本文件中的所有行或行

powershell Powershell函数用于在库中的SharePoint中创建文件夹和子文件夹

powershell PowerShell脚本,用于获取服务器场中所选用户的所有权限的列表。您还可以使用函数来获取烫发

用于导出sprint PBI的Powershell函数/脚本[关闭]

用于销毁资源的 Powershell 动词

用于验证 sql 语法错误的 Powershell 脚本