Move Pre and Post Install Parameters To Start-SqlSpade.ps1 ?

Sep 2, 2015 at 9:23 PM
Have you given any thought to allowing parameters for pre and post install scripts to be entered into a hash table as is done for the installation parameters?
Sep 29, 2015 at 11:36 AM
Hi Michael,

You can define additional parameters into the existing hash table ($ht) because all the pre-install and post-install PowerShell scripts can have access to this table when you define the following in each script:
$configParams = $args[0]
For example, we use this method to define a port number for a new named SQL Server instance and pass this to a post-installation script.

In Start-SqlSpade.ps1:
$ht.Add("InstancePortNumber", '1435')
Then, your post-install script which uses this parameter would include the following:
$configParams = $args[0]
$portNumber = $configParams["InstancePortNumber"]
Marked as answer by JasonCarter80 on 8/23/2016 at 5:00 PM
Nov 12, 2015 at 8:38 PM
Thanks, segmilne! That worked like a charm!