. (Join-Path $PSScriptRoot 'Build.Resources.ps1') function Read-PveCleanupChoice { while ($true) { $answer=([string](Read-Host '是否清理本轮构建的临时资源?(Y/N) [Y]')).Trim() if (-not $answer -or $answer -in @('y','yes')) { return $true } if ($answer -in @('n','no')) { return $false } Write-Host '请输入 Y 或 N,回车默认选择是。' -ForegroundColor Yellow } } function Test-PveBuildCancellationKey { if ([Console]::IsInputRedirected) { return $false } while ([Console]::KeyAvailable) { $key=[Console]::ReadKey($true) if ([int]$key.KeyChar -eq 3 -or ($key.Key -eq [ConsoleKey]::C -and ($key.Modifiers -band [ConsoleModifiers]::Control))) { return $true } } return $false } function Write-PveBuildOutput { param([string]$Line) if ($Line -eq '#< CLIXML') { return } if ($Line.StartsWith('