-
Notifications
You must be signed in to change notification settings - Fork 107
SPFarmSolution
Parameters
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| Name | Key | string | The filename of the WSP package | |
| LiteralPath | Required | string | The full path to the WSP file | |
| WebApplications | Write | string | A list of the web applications to deploy this to | |
| Ensure | Write | string | Present if the WSP should be deployed, or Absent if it should be removed | Present, Absent |
| Version | Write | string | The version of the package that is being modified | |
| Deployed | Write | Boolean | Should the solution be deployed to the farm, or just installed to the farm | |
| SolutionLevel | Write | string | What compatability level should the WSP be deployed as? | 14, 15, All |
| InstallAccount | Write | String | POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 |
Description
This resource is used to make sure that a specific farm solution is either present or absent in a farm. The Ensure property will dictate if the solution should be present or absent. The name property is the name of the solution including the wsp extension (i.e. MySolution.wsp). The LiteralPath is required and points to the solution in the files system that is used to upload it if it does not exist. The Version will be stored in the property bag to determine later if the correct version is installed. I the version in the farm does not match the desired version an upgrade of the solution will be performed.
The solution can be deployed to one or more web application passing an array of URL's to the WebApplications property. If the solution contains resources scoped for web applications and no WebApplications are specified, the solution will be deployed to all web applications. If the solution does not contain resources scoped for web applications the property is ignored and the solution is deployed globally.
Example
SPFarmSolution SampleWsp
{
Name = "MySolution.wsp"
LiteralPath = "C:\src\MySolution.wsp"
Ensure = "Present"
Version = "1.0.0"
WebApplications = @("http://collaboration", "http://mysites")
PsDscRunAsCredential = $InstallAccount
}

- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations