Powershell Extenstions: Install-UpdatePackage InstallMode

I am attempting to set up CI (Continuous Integration) for my Sitecore site and I want to use the Powershell extensions to do so.  I've figured out the remote aspect of it and all the other goodness that goes along with this, but one thing I cannot figure out is what is the difference between the InstallMode parameter of Install and Upgrade.  I found this little nugget on the Github Issues list regarding my question:

InstallMode and UpgradeAction I are part of the Sitecore.Update.dll.

but what do my options mean.  What happens when I do Install vs. Update?

Thanks in advance,

Nick

  • A bit late to the party but just came across this question...
    InstallMode will determine what happens when an item already exists.
    As the PowerShell Extensions documentation mentions, there are 2 options: Install or Update.
    When Install is used, it will configure a parameter called CollisionBehavior to be set to 'Force'.
    For Update on the other hand, 'Skip' will be used.
    This means that when using Update and a collission is detected (eg. a field already exists), it will NOT be changed.

    InstallMode is indeed part of Sitecore.Update.dll.
    The PowerShell InstallUpdatePackage will actually use the same functionality as the InstallUpdateWizard in Sitecore.
    The class that is used is DiffInstaller which will create a CommandInstallerContext where the CollisionBehavior is managed.
    If the package for example contains a taks to change an ItemField, it will eventually evaluate this:


    if (behavior != CollisionBehavior.Force)
           return;
    worker.UpdateField(field, valueEntry, context);