Using Octopus.Client.OctopusRepository.releases.FindByName()

I noticed that Octopus.Client.OctopusRepository.Release contains the Method FindByName
I have tried using it but not able to acquire any result.

e.g.
$endpoint = new-object Octopus.Client.OctopusServerEndpoint $octopusURI,$apikey
$repository = new-object Octopus.Client.OctopusRepository $endpoint
$repository.Releases.FindbyName(“0.5-R02070705”)

Am I doing anything wrong?
Regards
B.

Hi Binh,

That FindByName method on the releases repository doesn’t actually have a functionality. It only inherited it from one of the common resource interfaces.

What you should be using is $Repository.Projects.GetReleaseByVersio($project,"1.0.0") where $Project is an Octopus.Client.Model.ProjectResource object.

If you are still not using the open source project Octoposh, I highly recommend you to do so. In this case you could use Get-OctopusRelease -ProjectName "MyProject" -ReleaseVersion "0.5.0"

Cmdlet doc: http://octoposh.readthedocs.io/en/latest/cmdlets/get-octopusdeployment/#examples

Regards,
Dalmiro