I have a PowerShell script that is packaged into a NuGet package. The script contains parameters similar to the following:
param(
[Parameter(Mandatory=$True)][string] $databaseName,
[Parameter][switch] $blockOnPossibleDataLoss
)
I am trying to figure out the best way to call this script from a step template, where the step template has a variable that determines if the switch should be set. I haven’t been able to get it to work using either switch parameters or boolean parameters.
I understand that Octopus passes all variables as strings. What is the “approved” or best way to use variables for switches and/or bool parameters?