Scenario/Problem: You need to have access to extended SharePoint installation commands within PowerShell.
Solution: Download and install the SPModule
from Microsoft.
Before you can install SharePoint from within PowerShell, you need to download and install the SPModule
code from Microsoft. The downloadable file is located at www.microsoft.com/downloads/en/details.aspx?FamilyID=c57556ff-8df0-44fd-aba6-3df01b9f80ce (or search for “SPModule PowerShell”).
Unzip the file and place it into a local folder. Add this folder to the PSModulePath
environment variable. The code is unsigned, so you must allow unsigned scripts to run. See Chapter 2, “PowerShell Basics,” for steps on adding an environment variable and allowing the execution of unsigned scripts.
Launch Windows PowerShell by right-clicking the icon and selecting Run As Administrator. Import the modules extracted from the zipped SPModule
by using the commands in Listing 3.1.
Import-Module SPModule.misc
Import-Module SPModule.setup
Tip
You must set your execution policy to Unrestricted to successfully import the SPModule.misc
and SPModule.setup
files. You therefore are prompted upon import of some scripts. Entering an R for Run Once installs the scripts properly.
The cmdlets to install and configure SharePoint are now installed and ready for use.
Note
Importing the SPModule.misc
file performs a check for updates. If updates are available, you are notified. Perform any updates before proceeding.
18.221.98.71