Преглед изворни кода

ci: prove isolated IIS deployment on webserver-1

ci-iis-release-pipeline
Clawdbot пре 3 часа
родитељ
комит
dbcf2f44b0
1 измењених фајлова са 11 додато и 12 уклоњено
  1. +11
    -12
      scripts/install-iis-release.ps1

+ 11
- 12
scripts/install-iis-release.ps1 Прегледај датотеку

@@ -129,19 +129,18 @@ function Get-BindingInformation {
}

function Assert-HostCapabilities {
$getWindowsFeature = Get-Command Get-WindowsFeature -ErrorAction SilentlyContinue
$getOptionalFeature = Get-Command Get-WindowsOptionalFeature -ErrorAction SilentlyContinue
if ($null -ne $getWindowsFeature) {
$aspFeature = Get-WindowsFeature -Name Web-ASP
if ($null -eq $aspFeature -or -not $aspFeature.Installed) { throw 'The IIS Classic ASP feature (Web-ASP) is not installed.' }
} elseif ($null -ne $getOptionalFeature) {
$aspFeature = Get-WindowsOptionalFeature -Online -FeatureName IIS-ASP -ErrorAction SilentlyContinue
if ($null -eq $aspFeature -or $aspFeature.State -ne 'Enabled') { throw 'The IIS-ASP Windows feature is not enabled.' }
} else {
throw 'Classic ASP feature state cannot be verified: no supported Windows feature cmdlet is available.'
# Query IIS directly instead of Get-WindowsFeature/Get-WindowsOptionalFeature:
# those feature cmdlets can stall while collecting server-manager state.
$aspHandler = (Get-WebConfiguration -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/handlers').Collection |
Where-Object { $_.path -eq '*.asp' -and $_.modules -match '(^|,)IsapiModule(,|$)' -and $_.scriptProcessor -match '(?i)asp\.dll$' } |
Select-Object -First 1
if ($null -eq $aspHandler) {
throw 'The IIS Classic ASP handler (*.asp through asp.dll) was not found.'
}
if ($null -eq (Get-WebGlobalModule -Name AspModule -ErrorAction SilentlyContinue)) {
throw 'The IIS Classic ASP module (AspModule) was not found.'
try {
Get-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/asp' -Name 'enableParentPaths' -ErrorAction Stop | Out-Null
} catch {
throw "The IIS Classic ASP configuration section is unavailable: $($_.Exception.Message)"
}
if ($null -eq (Get-WebGlobalModule -Name RewriteModule -ErrorAction SilentlyContinue)) {
throw 'IIS URL Rewrite is not installed (RewriteModule was not found).'


Loading…
Откажи
Сачувај

Powered by TurnKey Linux.