Is it possible to have some optional arguments with the Powershell Runner? As an example, we have written a powershell script (Build-Databases.ps1) that restores a backup of our production databases, massages the data (updates email addresses to development email addresses, etc...), does a sql compare using Red Gate and some other stuff.
We have a convention we follow, and 90% of the time, we only need a single argument passed to our Build-Databases.ps1 script, the server name that we are deploying the database/scripts to.
However, we also have some additional argument overrides that allow you to be more verbose and specify options that we normally have defaults for.
I was attempting to use Build Parameters to pass into my powershell script, but it seemed like all or nothing.
Assume that 90% of the time we can call our script like this:
./Build-Databases.ps1 -Server "ServerA"
but sometimes we would like to call our script like this:
./Build-Databases.ps1 -Server "ServerA" -Option1 "Option1" -Option2 "Option2"
There isn't an easy way to handle the second scenario with TeamCity currently.
It would be really great if the Powershell Runner could "opt-in" to Build Parameters if they have a value, or ignore them they have no value. It seems like this would require some additional UI work to match the argument name with the argument value. Any ideas on how I could accomplish this?