add Enabled
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
"Name": "7-Zip",
|
"Name": "7-Zip",
|
||||||
"Id": "7zip.7zip",
|
"Id": "7zip.7zip",
|
||||||
"Version": "",
|
"Version": "",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "Command",
|
"Type": "Command",
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
"Name": "Google Chrome",
|
"Name": "Google Chrome",
|
||||||
"Id": "Google.Chrome",
|
"Id": "Google.Chrome",
|
||||||
"Version": "",
|
"Version": "",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "RegImport",
|
"Type": "RegImport",
|
||||||
@@ -26,6 +28,7 @@
|
|||||||
"Name": "OpenOffice",
|
"Name": "OpenOffice",
|
||||||
"Id": "Apache.OpenOffice",
|
"Id": "Apache.OpenOffice",
|
||||||
"Version": "4.116.9816",
|
"Version": "4.116.9816",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "Command",
|
"Type": "Command",
|
||||||
@@ -48,6 +51,7 @@
|
|||||||
"Name": "KeePassXC",
|
"Name": "KeePassXC",
|
||||||
"Id": "KeePassXCTeam.KeePassXC",
|
"Id": "KeePassXCTeam.KeePassXC",
|
||||||
"Version": "2.6.6",
|
"Version": "2.6.6",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "FileCopy",
|
"Type": "FileCopy",
|
||||||
@@ -60,6 +64,7 @@
|
|||||||
"Name": "VeraCrypt",
|
"Name": "VeraCrypt",
|
||||||
"Id": "IDRIX.VeraCrypt",
|
"Id": "IDRIX.VeraCrypt",
|
||||||
"Version": "1.26.20",
|
"Version": "1.26.20",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "FileCopy",
|
"Type": "FileCopy",
|
||||||
@@ -72,12 +77,14 @@
|
|||||||
"Name": "File Shredder",
|
"Name": "File Shredder",
|
||||||
"Id": "PowTools.FileShredder",
|
"Id": "PowTools.FileShredder",
|
||||||
"Version": "",
|
"Version": "",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": []
|
"PostInstall": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "VLC",
|
"Name": "VLC",
|
||||||
"Id": "VideoLAN.VLC",
|
"Id": "VideoLAN.VLC",
|
||||||
"Version": "",
|
"Version": "",
|
||||||
|
"Enabled": 1,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "FileCopy",
|
"Type": "FileCopy",
|
||||||
@@ -94,6 +101,7 @@
|
|||||||
"Name": "Adobe Acrobat Reader",
|
"Name": "Adobe Acrobat Reader",
|
||||||
"Id": "Adobe.Acrobat.Reader.64-bit",
|
"Id": "Adobe.Acrobat.Reader.64-bit",
|
||||||
"Version": "",
|
"Version": "",
|
||||||
|
"Enabled": 0,
|
||||||
"PostInstall": [
|
"PostInstall": [
|
||||||
{
|
{
|
||||||
"Type": "RegImport",
|
"Type": "RegImport",
|
||||||
7
main.ps1
7
main.ps1
@@ -10,7 +10,7 @@ if (-not (Test-Path "$PSScriptRoot\lib")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# === 2. 读取配置 ===
|
# === 2. 读取配置 ===
|
||||||
$jsonPath = "$PSScriptRoot\config\apps.json"
|
$jsonPath = "$PSScriptRoot\apps.json"
|
||||||
if (-not (Test-Path $jsonPath)) {
|
if (-not (Test-Path $jsonPath)) {
|
||||||
Write-Error "Cannot find: $jsonPath"
|
Write-Error "Cannot find: $jsonPath"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -22,6 +22,11 @@ $apps = Get-Content $jsonPath -Encoding UTF8 | ConvertFrom-Json
|
|||||||
|
|
||||||
# === 3. 主循环 ===
|
# === 3. 主循环 ===
|
||||||
foreach ($app in $apps) {
|
foreach ($app in $apps) {
|
||||||
|
if ($app.Enabled -ne 1) {
|
||||||
|
Write-Host "[Skipping] $($app.Name)" -ForegroundColor DarkGray
|
||||||
|
continue # 立即结束本次循环,进入下一个软件
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "`n==========================================" -ForegroundColor Cyan
|
Write-Host "`n==========================================" -ForegroundColor Cyan
|
||||||
Write-Host "Installing: $($app.Name)" -ForegroundColor Yellow
|
Write-Host "Installing: $($app.Name)" -ForegroundColor Yellow
|
||||||
Write-Host "=========================================="
|
Write-Host "=========================================="
|
||||||
|
|||||||
Reference in New Issue
Block a user