Octopus.client issue with creating releases

What is the proper way to use octopus.client to create releases?

When using the example powershell create release script on the octopus github site the create method returns an overload exception. Specifically, the command below.

$repository.Releases.Create($release)

Exception: Multiple ambiguous overloads found for “Create” and the argument count: “1”.

I can’t seem to find much documentation on what parameters to pass or properly use the create method. Yes we could directly interface with the octopus api through web requests but would prefer to stay within octopus.client if possible. We are using the github example script as is and only changing the variable values that are specific to our environment such as api key, server address and project id. Any help would be greatly appreciated.

https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/Octopus.Client/PowerShell/Releases/CreateRelease.ps1

Hi there,

Thanks for getting in touch.

The sample script you’ve used as a starting point should be updated to call $repository.Releases.Create($release, $false) as that method has an optional parameter and PowerShell doesn’t properly handle those (the second parameter is for ignoring channel rules and defaults to false).

I will update the sample script you’ve linked at some point today so other users don’t run into this same issue.

I hope that helps.

Thank you and best regards,
Henrik

1 Like

Henrik,
Thank you for the quick response. Adding the $false parameter resolved the issue for us. Much appreciated!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.