2

Closed

Get-Deployment returns exception when the slot is empty

description

When using

Get-Deployment -Slot "staging"

If the staging deployment does not exist, instead of returning $null, it returns an exception:

HTTP Status Code: ResourceNotFound - HTTP Error Message: No deployments were found.

The better solution would be for me to be able to call Get-Deployment without any -Slot parameter, to return all the existing deployments so I can decide to use either Set-Deployment or New-Deployment.

No files are attached

Closed Mar 12 at 1:03 PM by mwasham

Fixed with 2.2.2


comments

the_skipster wrote Jan 29 at 5:30 PM

This is a workaround, not a solution.

I can always use -ErrorAction SilentlyContinue on any command to solve just about any problem. Hiding the issues does not resolve the issue.

Using -ErrorAction hides ALL errors, not just the fact that there is no deployment in that slot. This is highly risky and difficult to debug if another issue arises that is not related to there not being a deployment in that slot.

I should be able to:

execute Get-Deployment without any options to get all deployments that are currently available.
execute Get-Deployment with a -Slot parameter and get either a $null back if there is no deployment in that slot, or a deployment object if there is.

mwasham wrote Jan 29 at 5:30 PM

closed with workaround of using -ErrorAction SilentlyContinue

** Closed by mwasham 26/01/2012 1:14 PM

mwasham wrote Jan 26 at 8:07 PM

You can work around this problem by adding: -ErrorAction SilentlyContinue