Applied the same critical fixes from Deploy-ApiServer.ps1 v1.3 to Deploy-WebDashboard.ps1.
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8Status: ? APPLIED
Location: Lines 60-62 (after $ErrorActionPreference)
if ($global:DeployWebDashboardRunning) {
Write-Host "? Script is already running in another instance" -ForegroundColor Red
exit 1
}
$global:DeployWebDashboardRunning = $trueStatus: ? APPLIED Location: Lines 64-68
?(U+2713) for success?(U+2717) for errors?(U+26A0) for warnings
Status: ? MOSTLY APPLIED Locations:
- Write-Success function: ? Updated to ?
- Test-Prerequisites: ? Updated (? for errors, ? for warnings)
- New-ApplicationPool: ? Updated (? for "already exists")
function Has-Command {
param([string]$Name)
return [bool](Get-Command $Name -ErrorAction SilentlyContinue)
}Status: ? APPLIED Location: After Test-Prerequisites function
- Checks for IIS: drive availability
- Falls back to ServerManager API when needed
- Proper state checking
Status: ? APPLIED Location: New-ApplicationPool function completely rewritten
Need to add:
- Sleep after stopping app pool (500ms)
- Better error handling
- State checking
Need to add:
- IIS PSDrive detection
- Proper SSL certificate binding with Set-ItemProperty
- Icon updates
Need to add:
- IIS PSDrive detection
- Graceful skip when unavailable
Need to add:
$script:WebSiteStartAttemptedguard- State checking before starting
- Better error messages
Need to add:
} finally {
$global:DeployWebDashboardRunning = $false
}| Feature | Deploy-ApiServer.ps1 | Deploy-WebDashboard.ps1 | Status |
|---|---|---|---|
| UTF-8 Encoding | ? v1.3 | ? APPLIED | Complete |
| Guard Variable | ? v1.3 | ? APPLIED | Complete |
| Unicode Icons | ? All | ? Partial | ~80% done |
| Has-Command | ? v1.3 | ? APPLIED | Complete |
| New-ApplicationPool | ? v1.3 | ? APPLIED | Complete |
| Copy-Files (sleep) | ? v1.2 | ? TODO | Needed |
| New-IisWebsite (PSDrive) | ? v1.3 | ? TODO | Needed |
| Set-WebConfiguration | ? v1.3 | ? TODO | Needed |
| Start-WebSite (guard) | ? v1.2 | ? TODO | Needed |
| Finally Block | ? v1.2 | ? TODO | Needed |
Completed: 5 out of 10 major fixes Critical fixes applied: UTF-8 encoding, guard variable, PSDrive detection in app pool Remaining: Website creation, starting, and finalization logic
- Update Copy-WebFiles with sleep and better error handling
- Update New-IisWebsite with PSDrive detection and SSL fix
- Update Set-WebConfiguration with PSDrive detection
- Update Start-WebSite with loop protection
- Add finally block to main execution
- Complete remaining icon updates
- Test the script
- Create comprehensive documentation
After completing remaining fixes:
- Script loads without syntax errors
- WhatIf mode works correctly
- Deployment succeeds with WebAdministration module
- Deployment succeeds with IISAdministration module
- SSL certificate properly bound
- Application pool starts correctly
- Website responds correctly
- No infinite loops
- UTF-8 icons display correctly
Current: v1.0 (original with partial fixes) Target: v1.3 (matching Deploy-ApiServer.ps1 v1.3)
scripts/Deploy-ApiServer.ps1- Source of all fixes (v1.3)scripts/Deploy-WebDashboard.ps1- Work in progressDEPLOY_APISERVER_INFINITE_LOOP_FIX.md- Loop protection docsDEPLOY_APISERVER_UTF8_ENCODING_FIX.md- UTF-8 encoding docs