Contents
New-SPSite -Url “your Site collection URL” -OwnerAlias “domainser” -Template $template
- First step is to copy your script to a note pad and save as with .ps1 extension.
- In my case I saved the script as SiteCollection.
- On the Start menu, click All Programs.
- Click Microsoft SharePoint 2010 Products.
The Add-PSSnapin cmdlet adds registered Windows PowerShell snap-ins to the current session. Beginning in Windows PowerShell 3.0, the core commands that are included in Windows PowerShell are packaged in modules. The exception is Microsoft. PowerShell. Core, which is a snap-in (PSSnapin).
How do I open the PowerShell window in SharePoint?
To open the SharePoint Online Management Shell command prompt, from the Start screen, type sharepoint, and then click SharePoint Online Management Shell.
How to install SharePoint 2013 PowerShell module on…?
A very good alternative that you can install is PnP PowerShell, you can install that simply by entering (for SharePoint 2013): You can use the following reference to see supported cmdlets: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps#cmdlet-overview
Next, the SharePoint snap-in is loaded (Microsoft .NET Framework assemblies that may contain custom Windows PowerShell cmdlets). The SharePoint 2010 snap-in for Windows PowerShell contains more than 500 cmdlets that you can use to perform a large variety of administrative tasks.
How to load a module into a PowerShell session?
To load a module into your PowerShell session, use the Import-Module cmdlet like so: What we SharePoint administrators need to know is that, for whatever reason, the Microsoft SharePoint product team cleaves to the Powershell v1 snap-in motif to deploy the over 800 cmdlets included in SharePoint 2013.
How to setup SharePoint in Windows PowerShell 3.0?
Thus, we see that you gain no real practical advantage by invoking the SharePoint Management Shell, Instead, simply customize your PowerShell profile to set up the environment and load the SharePoint snap-in, and you’re good to go. A new feature introduced in Windows PowerShell 3.0 is updatable help.