2

我想知道是否可以确定给定服务(以及相应的插槽(ProductionStaging))是否存在部署。

我发现的只是调用它会在 PowerShell 中Get-AzureDeployment -ServiceName xxxservice抛出一个错误。Get-AzureDeployment : ResourceNotFound: No deployments were found.

4

1 回答 1

4

尝试 -ErrorVariable 和 -ErrorAction 参数

$deployment = Get-AzureDeployment -ServiceName $serviceName -Slot $slot -ErrorVariable a -ErrorAction silentlycontinue 
if ($a[0] -ne $null)
{
    Write-Output "$(Get-Date –f $timeStampFormat) - No deployment is detected."
}
于 2013-12-27T09:23:37.473 回答