I am running a Powershell Script using Sitecore Powershell Module remoting service to install .update packages from my host to a remote Sitecore instance but I am not getting any details back on the package installation....
this is my script:
Param(
[string]$SitecoreInstanceUri = "http://SitecoreTestInstance",
[string]$SitecorePackagePath = "C:\test\AllLocalUpdatePackages",
[string]$UpgradeAction = "Upgrade",
[string]$InstallMode = "Install",
[string]$SitecoreAdminUser = "admin",
[string]$SitecoreAdminUserPassword = "b",
[array]$UpdatePackages = @("ASF.Main.Core")
)
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
import-Module -Name SPE
#find the real path of the package based on the partial package path given
$UpdatePackages | ForEach-Object -Process {
try {
$pattern = $_ + "*"
$packagePath = ($SitecorePackagePath | Get-ChildItem -Include $pattern -
Recurse)
$parameters = @{"Path" = $packagePath.FullName; "UpgradeAction" =
$UpgradeAction; "InstallMode" = $InstallMode }
$session = New-ScriptSession -Username $SitecoreAdminUser -Password
$SitecoreAdminUserPassword -ConnectionUri $SitecoreInstanceUri -Timeout
300
#Install Package
Write-verbose "Installing Sitecore update Package
$($packagePath.FullName) on $($SitecoreInstanceUri)" -verbose
$jobId = Invoke-RemoteScript -Session $session -ScriptBlock {
$ErrorActionPreference = "Stop"
try {
Install-UpdatePackage -Path $(($using:parameters).Path) -
UpgradeAction $(($using:parameters).UpgradeAction) -InstallMode
$(($using:parameters).InstallMode) | Select-Object -Property
LongDiscription
$package = ($using:parameters).Path
}
catch {
$errorMessage = $_
Write-Verbose "Following error occured when installing
$($package) : $($errorMessage)"
}
} -AsJob -Verbose
#Query the job status to see if the item install is done
Wait-RemoteScriptSession -Session $session -Id $jobId -Delay 5 -Verbose
}
catch {
$ErrorMessage = $_.Exception.Message
Write-verbose $ErrorMessage
Write-Host "Issue Occured with this particular package"
}
}