Install-SitecoreConfiguration cmdlet using From and To parameter for specific task execution

The Sitecore installation has more than 200 tasks. It is usual for the tasks to fail in the middle. It is always good to pass values to just one or few tasks to see how they behave when a set of fixed params is passed. A quick "get-help Install-SitecoreConfiguration" provides the following results:
The "get-help Install-Siteconfiguration -examples", offers examples too:

Out of the above list, the  "Install-SitecoreConfiguration -Path .\MyConfig.json -From Beta" and  "Install-SitecoreConfiguration -Path .\MyConfig.json -From Alpha -To Beta" examples seem relevant and more intuitive to the scenario. 

Let's test the cmdlet on RebuildIndex-Core task.

Note that the task names can be found from the log files. Based on the task name, its easy to find the concerned json file (for the Path param) needed to execute the Install-SitecoreConfiguration PS script:
Ensure to execute the following cmdlet in the correct location. Understandably, the cmdlet and location will differ based on the task and json file involved. 

Install-SitecoreConfiguration -Path .\Common.RebuildIndexes.json  -From RebuildIndex-Core -To RebuildIndex-Core


Only the specified tasks in the specified json file execute. 


Note:
- Ensure to provide Default Value needed for the input params in the json file. In this case, Common.RebuildIndexes.json expects BaseUrl param and so, had to provide a DefaultValue param. Without the DefaultValue, the execution fails with this error:

[--------------------------------------- RebuildIndex-Core : WebRequest ----------------------------------------------]
[RebuildIndex-Core]:[Requesting] /RebuildIndex.aspx?index=sitecore_core_index
WARNING: [1/5] Request Failed: Invalid URI: The hostname could not be parsed.
[RebuildIndex-Core]:[Requesting] /RebuildIndex.aspx?index=sitecore_core_index
WARNING: [2/5] Request Failed: Invalid URI: The hostname could not be parsed.
[RebuildIndex-Core]:[Requesting] /RebuildIndex.aspx?index=sitecore_core_index
WARNING: [3/5] Request Failed: Invalid URI: The hostname could not be parsed.
[RebuildIndex-Core]:[Requesting] /RebuildIndex.aspx?index=sitecore_core_index
WARNING: [4/5] Request Failed: Invalid URI: The hostname could not be parsed.
[RebuildIndex-Core]:[Requesting] /RebuildIndex.aspx?index=sitecore_core_index
WARNING: [5/5] Request Failed: Invalid URI: The hostname could not be parsed.
Install-SitecoreConfiguration : Could not complete request for /RebuildIndex.aspx?index=sitecore_core_index - Invalid
URI: The hostname could not be parsed.
At line:1 char:1
+ Install-SitecoreConfiguration -Path .\Common.RebuildIndexes.json -Fro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

[TIME] 00:00:08
Could not complete request for /RebuildIndex.aspx?index=sitecore_core_index - Invalid URI: The hostname could not be
parsed.
At C:\Users\xyz\Documents\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Tasks\Invoke-WebRequestTask.p
s1:37 char:21
+                     Throw "Could not complete request for $Uri - $_"
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not compl... not be parsed.:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not complete request for /RebuildIndex.aspx?index=sitecore_core_index - Invalid UR
   I: The hostname could not be parsed.



Comments