We want to use Powershell to retrieve only the most recent release number for given Project and Environment.
The following code gets the deployments for a given Project and Environment.
$buildProject = $od.Projects.FindByName("Build")
$buildProjectId = $buildProject.Id
$devEnv = $od.Environments.FindByName("DEV")
$devEnvId = $devEnv.Id
$deployments = $od.Deployments.FindAll() | Where-Object {$_.ProjectId -eq $buildProjectId -and $_.EnvironmentId -eq $devEnvId}
Now we want to derive the latest release number. Any ideas on how to proceed?