add Enabled
This commit is contained in:
7
main.ps1
7
main.ps1
@@ -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 "=========================================="
|
||||
|
||||
Reference in New Issue
Block a user