Created
July 26, 2016 18:37
-
-
Save michaellwest/14e9ef98f9e8b450c1b39813d13cbc50 to your computer and use it in GitHub Desktop.
Simple example to installing a module package on a remote Sitecore instance. The package already exists on the server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module -Name SPE -Force | |
$packageName = "$($SitecorePackageFolder)\[PACKAGE].zip" | |
$session = New-ScriptSession -Username "admin" -Password "b" -ConnectionUri "http://remotesitecore" | |
Test-RemoteConnection -Session $session -Quiet | |
$jobId = Invoke-RemoteScript -Session $session -ScriptBlock { | |
[Sitecore.Configuration.Settings+Indexing]::Enabled = $false | |
Get-SearchIndex | ForEach-Object { Stop-SearchIndex -Name $_.Name } | |
Import-Package -Path "$($SitecorePackageFolder)\$($using:packageName)" -InstallMode Merge -MergeMode Merge | |
[Sitecore.Configuration.Settings+Indexing]::Enabled = $true | |
} -AsJob | |
Wait-RemoteScriptSession -Session $session -Id $jobId -Delay 5 -Verbose | |
Stop-ScriptSession -Session $session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment