octopus-LogOctopusParameters
Creates and writes a powershell script to the Release Task Log during deployment. This powershell script can be copy/pasted to a powershell console, and it will generate an $OctopusParameters variable with all of the values used during the deployment, along with helper methods .ToGridView(), .ToScreen(), and .ToClipBoard() which should be self explanatory. This should help with debugging deployments.
This is what the log output looks like for this step:
Tentacle Script Execution
#Copy this log section to a Powershell Editor or terminal. and run it.
#It will create an $OctopusDeploy Dictionary Variable.
function info { param([string] $time) process {}}
$OctopusParameters = @{}
$OctopusParameters.Add("Parameter_1", "Foo")
$OctopusParameters.Add("Parameter_2", "Bar")
#... one line for every OctopusParameter entry
$OctopusParameters | add-member -memberType ScriptMethod -Name ToClipboard -value {$this.GetEnumerator() |sort -Property Name | format-table -AutoSize | out-string -width 512 | set-clipboard; };
$OctopusParameters | add-member -memberType ScriptMethod -Name ToGridView -value {$this.GetEnumerator() |sort -Property Name | out-gridview; };
$OctopusParameters | add-member -memberType ScriptMethod -Name ToScreen -value {$this.GetEnumerator() |sort -Property Name | format-table -AutoSize | out-string -width 512; };
CLS
write-host "To display a gridview of the Octopus Parameters, run this command: `$OctopusParameters.ToGridView()"
write-host "To list the Octopus Parameters, run this command: `$OctopusParameters.ToScreen()"
write-host "To copy the Octopus Parameters to the clipboard, run this command: `$OctopusParameters.ToClipboard()"
Info 14:30:17
==============================================
PowerShell exit code: 0
==============================================