|
|
@@ -200,8 +200,10 @@ function Get-TargetState { |
|
|
} |
|
|
} |
|
|
$bindings = @($site.Bindings.Collection) |
|
|
$bindings = @($site.Bindings.Collection) |
|
|
$expectedBinding = Get-BindingInformation |
|
|
$expectedBinding = Get-BindingInformation |
|
|
if ($bindings.Count -ne 1 -or $bindings[0].protocol -ne 'http' -or $bindings[0].bindingInformation -ne $expectedBinding) { |
|
|
|
|
|
throw "Existing target binding does not exactly match http/$expectedBinding. Refusing adoption or binding changes." |
|
|
|
|
|
|
|
|
# Extra bindings (for example www or localhost) are left untouched; the expected binding must be present. |
|
|
|
|
|
$hasExpectedBinding = @($bindings | Where-Object { $_.protocol -eq 'http' -and $_.bindingInformation -eq $expectedBinding }).Count -gt 0 |
|
|
|
|
|
if (-not $hasExpectedBinding) { |
|
|
|
|
|
throw "Existing target does not have the expected binding http/$expectedBinding. Refusing adoption or binding changes." |
|
|
} |
|
|
} |
|
|
$physicalPath = Get-NormalizedPath $site.physicalPath |
|
|
$physicalPath = Get-NormalizedPath $site.physicalPath |
|
|
$releasesRoot = Join-Path $DeployRoot 'releases' |
|
|
$releasesRoot = Join-Path $DeployRoot 'releases' |
|
|
|