diff --git a/Data/basic-apps.csv b/Data/basic-apps.csv index 08f4aa53..9db5fb3f 100644 --- a/Data/basic-apps.csv +++ b/Data/basic-apps.csv @@ -2,7 +2,7 @@ APPNAME, CATEGORY, APPID "7-Zip", "file tool", "XPDNKVCX4QD2DC" "Aquile Reader", "ebook reader", "9P08T4JLTQNK" "CrystalDiskInfo", "HDD/SSD tool", "XP8K4RGX25G3GM" -"Google Chrome", " desktop browser", "Google.Chrome" +"Google Chrome", "desktop browser", "Google.Chrome" "Dopamine", "audio player", "Digimezzo.Dopamine.2" "Dropbox", "file sync", "Dropbox.Dropbox" "Git for Windows", "code management", "Git.Git" diff --git a/Scripts/install-basic-apps.ps1 b/Scripts/install-basic-apps.ps1 index 071fc09c..cab02166 100755 --- a/Scripts/install-basic-apps.ps1 +++ b/Scripts/install-basic-apps.ps1 @@ -15,31 +15,33 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() - "⏳ Step 1 - Loading table from Data/basic-apps.csv..." + "⏳ Step 1 - Loading Data/basic-apps.csv..." $Table = Import-CSV "$PSScriptRoot/../Data/basic-apps.csv" $NumEntries = $Table.count - Write-Host " About to install $NumEntries apps: " -NoNewline + Write-Host " The following $NumEntries basic apps will be installed or upgraded: " -NoNewline foreach($Row in $Table) { [string]$AppName = $Row.AppName Write-Host "$AppName, " -NoNewline } "" - "Press to abort, otherwise the installation will start..." - sleep -s 3 + "Press to abort, otherwise the installation will start in 10 seconds..." + sleep -s 10 [int]$Step = 2 + [int]$Failed = 0 foreach($Row in $Table) { [string]$AppName = $Row.AppName [string]$Category = $Row.Category [string]$AppID = $Row.AppID - "⏳ Step $Step/$($NumEntries + 1) - Installing $AppName ($Category)..." + "⏳ ($Step/$($NumEntries + 1)) Installing $AppName ($Category)..." & winget install --id $AppID --accept-package-agreements --accept-source-agreements - if ($lastExitCode -ne "0") { throw "'winget install' for $AppName failed" } + if ($lastExitCode -ne "0") { Write-Warning "'winget install' for $AppName failed"; $Failed++ } $Step++ } + [int]$Installed = ($NumEntries - $Failed) [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ installed $NumEntries apps in $Elapsed sec" + "✔️ installed $Installed basic apps in $Elapsed sec. ($Failed failed)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"