Loading...
Area: Optimizely CMS

Recommended reading 

This article describes how to manage add-ons using PowerShell cmdlets shipped with EPiServer Deployment Center, these are not available when creating sites using Visual Studio.

Command line support for the add-on system is implemented as a PowerShell snap-in with a set of CmdLets. The add-on system CmdLets are pluggable so that it does not need to be updated when a site or the add-on system is updated. All operations with add-ons are executed using methods from the EPiServer.Packaging assembly located on the same site where the operation is going to take place.

Technically add-on system CmdLets tries to find a type that implements EPiServer.Packaging.CmdAPI.IPackagingCommands interface defined in EPiServer.Packaging.CmdAPI assembly.

Common parameters

  • ApplicationPath this is mandatory parameter for all CmdLets. It points to the physical location of the web application.
  • ApiPath is an optional parameter. It can be used to specify a source folder for the assemblies required for packaging operations at runtime. The folder specified in the ApiPath parameter should contain the following assemblies:
    • EPiServer.Framework
    • EPiServer.Data
    • EPiServer.Shell
    • EPiServer.Packaging
    • EPiServer.Packaging.CmdAPI
    • NuGet.Core
If the ApiPath parameter is not specified the assemblies will be loaded from the bin and modulesbin directories under ApplicationPath.

Get-EPiAddOns

Get-EPiAddOns lists installed add-ons on a site. If a FeedName parameter with the add-ons feed name is specified, the command returns a list of add-ons that can be installed on a site from the specified feed.

Parameters

  • FeedName is the name of the feed to display installable add-ons. If omitted the list of add-ons installed on a site is displayed.

Example of usage

List all installed add-ons on a site:

Get-EPiAddOns ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite 

List all add-ons that can be installed on a site from a feed named EPiServerBetaAddOns:

Get-EPiAddOns ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite FeedName EPiServerBetaAddOns

List all installed add-ons on a site, using EPiServer.Packaging assembly from specified location:

Get-EPiAddOns ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite BasePath C:\Program Files (x86)\EPiServer\Framework\7.5.343.4\Install\Tools

Get-EPiAddOnFeeds

Get-EPiAddOnFeeds returns a list of add-on feeds configured on the site. This CmdLet does not have any additional parameters except the common ones.

Add-EPiAddOn

Add-EPiAddOn installs an add-on from a feed or from a file. In order to install an add-on from a feed the add-on ID and Version need to be specified. In order to install an add-on from a file only the file name is needed.

Parameters

  • Id is the ID of the add-on to install
  • Version is the version of the add-on to install
  • Files is the single- or comma-separated list of add-on package files to install on a website

Example of usage

Install an add-on from a feed:

Add-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Id EPiServer.Social Version 1.1.0.0

Install add-ons from files:

Add-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Files
C:\MyPackages\EPiServer.Social.1.1.0.0.nupkg,EPiServer.GoogleAnalytics.1.2.0.0.nupkg

Remove-EPiAddOn

Remove-EPiAddOn removes an add-on from a site.

Warning Remove operation is not exactly the same operation that is executed when an add-on is uninstalled from the web interface, so please use it only if there is no possibility to uninstall from the web interface. The difference is in the notification system. If an add-on is uninstalled from a site through the web interface, the add-on get notified about this operation before the actual uninstallation with a call to the BeforeUninstall method. If an add-on is removed by CmdLet, there is no technical possibility to execute notification. Refer to the Add-ons section for more information about add-ons custom code execution.

Parameters

  • Id is the ID of the add-on to remove
  • Version is the version of the add-on to remove

Example of usage

Remove an add-on:

Remove-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Id EPiServer.Social Version 1.1.0.0

Update-EPiAddOn

Update-EPiAddOn updates an installed or disabled add-on to a new version.

Parameters

  • Id is the ID of the add-on to update
  • Version is the version of the add-on to update

Example of usage

Update an add-on:

Update-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Id EPiServer.Social Version 2.0.0.0

Enable-EPiAddOn

Enable-EPiAddOn enables a previously disabled add-on on a website.

Parameters

  • Id is the ID of the add-on to enable
  • Version is the version of the add-on to enable

Example of usage

Enable an add-on:

Enable-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Id EPiServer.Social Version 1.1.0.0

Disable-EPiAddOn

Disable-EPiAddOn disables an add-on on a website. Disabling an add-on means that the add-on files get removed from the site and after site restart no add-ons code is executed. A reference to the disabled add-on and the add-on package file is stored in a separate repository. Add-on does not get notification.

Parameters

  • Id is the ID of the add-on to disable
  • Version is the version of the add-on to disable

Example of usage

Disable an add-on:

Disable-EPiAddOn ApplicationPath C:\EPiServer\Sites\ExampleEPiServerSite Id EPiServer.Social Version 1.1.0.0

See also

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jul 09, 2014

Recommended reading