add Enabled
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"Name": "7-Zip",
|
||||
"Id": "7zip.7zip",
|
||||
"Version": "",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "Command",
|
||||
@@ -15,6 +16,7 @@
|
||||
"Name": "Google Chrome",
|
||||
"Id": "Google.Chrome",
|
||||
"Version": "",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "RegImport",
|
||||
@@ -26,6 +28,7 @@
|
||||
"Name": "OpenOffice",
|
||||
"Id": "Apache.OpenOffice",
|
||||
"Version": "4.116.9816",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "Command",
|
||||
@@ -48,6 +51,7 @@
|
||||
"Name": "KeePassXC",
|
||||
"Id": "KeePassXCTeam.KeePassXC",
|
||||
"Version": "2.6.6",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "FileCopy",
|
||||
@@ -60,6 +64,7 @@
|
||||
"Name": "VeraCrypt",
|
||||
"Id": "IDRIX.VeraCrypt",
|
||||
"Version": "1.26.20",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "FileCopy",
|
||||
@@ -72,12 +77,14 @@
|
||||
"Name": "File Shredder",
|
||||
"Id": "PowTools.FileShredder",
|
||||
"Version": "",
|
||||
"Enabled": 1,
|
||||
"PostInstall": []
|
||||
},
|
||||
{
|
||||
"Name": "VLC",
|
||||
"Id": "VideoLAN.VLC",
|
||||
"Version": "",
|
||||
"Enabled": 1,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "FileCopy",
|
||||
@@ -94,6 +101,7 @@
|
||||
"Name": "Adobe Acrobat Reader",
|
||||
"Id": "Adobe.Acrobat.Reader.64-bit",
|
||||
"Version": "",
|
||||
"Enabled": 0,
|
||||
"PostInstall": [
|
||||
{
|
||||
"Type": "RegImport",
|
||||
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