add Enabled

This commit is contained in:
Julian Freeman
2025-12-06 07:27:04 -04:00
parent 58f026f30f
commit e58df80181
2 changed files with 14 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ if (-not (Test-Path "$PSScriptRoot\lib")) {
}
# === 2. 读取配置 ===
$jsonPath = "$PSScriptRoot\config\apps.json"
$jsonPath = "$PSScriptRoot\apps.json"
if (-not (Test-Path $jsonPath)) {
Write-Error "Cannot find: $jsonPath"
exit 1
@@ -22,6 +22,11 @@ $apps = Get-Content $jsonPath -Encoding UTF8 | ConvertFrom-Json
# === 3. 主循环 ===
foreach ($app in $apps) {
if ($app.Enabled -ne 1) {
Write-Host "[Skipping] $($app.Name)" -ForegroundColor DarkGray
continue # 立即结束本次循环,进入下一个软件
}
Write-Host "`n==========================================" -ForegroundColor Cyan
Write-Host "Installing: $($app.Name)" -ForegroundColor Yellow
Write-Host "=========================================="