# Quick View Update - Copy changed view files without restarting site # Run this after editing views to update live site without downtime param( [string]$ViewFile = "" ) $devPath = "E:\Documents\Website Projects\Sky_Art_Shop" $prodPath = "C:\inetpub\wwwroot\skyartshop" if ($ViewFile) { # Copy specific file $sourceFile = Join-Path $devPath $ViewFile $destFile = Join-Path $prodPath $ViewFile if (Test-Path $sourceFile) { $destDir = Split-Path $destFile -Parent if (-not (Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir -Force | Out-Null } Copy-Item $sourceFile $destFile -Force Write-Host "āœ… Updated: $ViewFile" -ForegroundColor Green # Touch web.config to trigger reload without restart $webConfig = Join-Path $prodPath "web.config" if (Test-Path $webConfig) { (Get-Item $webConfig).LastWriteTime = Get-Date Write-Host "āœ… Site reloaded automatically (no downtime)" -ForegroundColor Cyan } } else { Write-Host "āŒ File not found: $sourceFile" -ForegroundColor Red } } else { # Sync all Views Write-Host "šŸ”„ Syncing all views..." -ForegroundColor Cyan $viewsSource = Join-Path $devPath "Views" $viewsDest = Join-Path $prodPath "Views" if (Test-Path $viewsSource) { Copy-Item -Path $viewsSource -Destination $prodPath -Recurse -Force Write-Host "āœ… All views synced" -ForegroundColor Green # Touch web.config $webConfig = Join-Path $prodPath "web.config" if (Test-Path $webConfig) { (Get-Item $webConfig).LastWriteTime = Get-Date Write-Host "āœ… Site reloaded automatically" -ForegroundColor Cyan } } } Write-Host "`nšŸ’” Usage examples:" -ForegroundColor Yellow Write-Host " .\quick-update.ps1 # Sync all views" Write-Host " .\quick-update.ps1 'Views\Shared\_AdminLayout.cshtml' # Update specific view"