Support PowerShell parameters in deploy.ps1
At present, deploy.ps1 scripts can't have 'true' PowerShell parameters, and instead have to go poking around in $OctopusParameters to see what configuration they should be using. This prevents the user from (easily) testing the deployment on their desktop.
People have resorted to ingenious hackery to get around this (see http://www.lavinski.me/making-great-octopus-powershell-step-templates/), but whilst clever, it's more work than if parameters were just directly supported, and can't support mandatory parameters, parameter sets etc...
Instead I think Octopus should directly support parameters on scripts, and bind octopus variables to the parameters automatically. So your deploy.ps1 could look like this:
param(
$databaseServer,
$databaseName
)
rest of your script here
...and Octopus would take care of satisfying the two parameters for the script based on variables with those names. This is not actually that hard - I already use a shim script in all my packages which does exactly this, but having it supported OOB would just make everything much cleaner.
The ultimate outcome would be that you'd be able to go into your project and test your custom deployment script as you'd expect:
deploy.ps1 -databaseName:MyDatabase -databaseServer:localhost etc...

-
Piers Williams commented
Looking in the Calamari source it'd be really easy to splice this into the existing Bootstrap.ps1 script, just not sure I've got the time to setup an environment to test it in.
-
Piers Williams commented
Sorry I forgot the link to my shim script: https://gist.github.com/piers7/f637240ec8408ae6176c
This binds as many Octopus variables to explicit script parameters as it can, and passes the rest as a hashtable to a parameter called 'properties'