Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.06 KB

File metadata and controls

78 lines (61 loc) · 2.06 KB

Apply All Fixes to Deploy-WebDashboard.ps1

Status Summary

? Already Applied

  1. UTF-8 encoding configuration
  2. Guard variable ($global:DeployWebDashboardRunning)
  3. Write-Success function with ? icon
  4. Most icons in Test-Prerequisites updated (?, ?)

?? To Apply

1. Add Has-Command Function (After Test-Prerequisites)

function Has-Command {
    param([string]$Name)
    return [bool](Get-Command $Name -ErrorAction SilentlyContinue)
}

2. Update New-ApplicationPool Function

  • Add IIS PSDrive detection
  • Add fallback to ServerManager API
  • Change icons to ? for "already exists"

3. Update Copy-WebFiles Function

  • Add sleep after stopping app pool (500ms)
  • Better error handling
  • State checking before stopping

4. Update New-IisWebsite Function

  • Add IIS PSDrive detection
  • Fix SSL certificate binding (use Set-ItemProperty)
  • Change icons to ? for warnings

5. Update Set-WebConfiguration Function

  • Add IIS PSDrive detection
  • Graceful skip if not available

6. Update Start-WebSite Function

  • Add $script:WebSiteStartAttempted guard
  • Add state checking before starting
  • Better error messages with ?

7. Update Test-WebSite Function

  • Change icons to ?/? as appropriate

8. Add Finally Block to Main Execution

} finally {
    # Ensure guard is always cleared
    $global:DeployWebDashboardRunning = $false
}

9. Add Success Message at End

Write-Host ""
Write-Host "? Deployment completed successfully" -ForegroundColor Green
Write-Host ""

Quick Application Method

Since Deploy-WebDashboard.ps1 has the same structure as Deploy-ApiServer.ps1, we can:

  1. Copy key functions from Deploy-ApiServer.ps1
  2. Replace references to "Api" with "Web" or "Dashboard"
  3. Keep the Web-specific configuration

Renamed Items

Deploy-ApiServer.ps1 Deploy-WebDashboard.ps1
SecureBootDashboard.Api SecureBootDashboard.Web
api.yourdomain.com dashboard.yourdomain.com
API Server Web Dashboard
api-*.log web-*.log