To create a SharePoint site using PowerShell in SharePoint development, you should learn to manage SharePoint sites using PowerShell. The SharePoint Management Shell is a Windows PowerShell module that you can use to efficiently manage SharePoint users, sites, site collections, and organizations. This teaches you a simple statement to create a SharePoint site. Enter the statement. The information in the red box appears after you press ENTER.
The website is set up as follows:
First we need to understand how to create a site using PowerShell. New-spweb This special command has only one necessary element, the URL of the site, but there are many other parameters that can be used to enrich the site information when the site is created. -url: The URL of the newly created site. -template: Add the template number. -name: Displays the site name. -addtotopnav: Whether you want the site to appear in the top navigation bar. -useparenttopnav: Whether you want the site to use the parent site's navigation. Tested to support Chinese characters website name. For information about SharePoint 2010 site template names and IDs, see HTTP://BLOGS.MSDN.COM/B/RICHIN/ARCHIVE/2011/07/04/ Sharepoint-2010-site-template-names.aspx If you are not sure which templates are available, you can use Get-spwebtemplate to return a list of available templates.
Supplement Create a new Web application new-spwebapplication-name <name>-hostheader ------------------------------------Split Line----------------------------------------new-spwebapplication-name " Company Intranet "-hostheader" intranet.company.com "-port 80-url" http://intranet.company.com:80 "-applicationpool" SharePoint Web Applications "-applicationpoolaccount (Get-spmanagedaccount" Companysp_service ")-databasename" WSS_ Content_intranet "
Delete Web application remove-spwebapplication http://intranet.company.com-DeleteIISSite-RemoveContentDatabase-Confirm: $false
Create a content database new-spcontentdatabase-name<contentdbname>-webapplication <WebApplicationName>
------------------------------------Split Line----------------------------------------
New-spcontentdatabase-name wss_content_intranet_sales-webapplication http://intranet.company.com
Create a site collection New-spsite-url "<url for the new site collection>"-name <name>-contentdatabase <content database n ame>-owneralias "<domainuser>"-template <template>
------------------------------------Split Line----------------------------------------
New-spsite-url "Http://intranet.company.com/sites/sales"-name "Sales"-contentdatabase wss_content_intranet_ Sales-owneralias "Companyspadmin"-template "sts#0″ Above is also not a new knowledge, in other places you can also see. I'll summarize here, just to be able to quote them very quickly for the time being needed.