From 0662cacf4dd410c5aa20d1671952325108018d8c Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 13 May 2024 16:47:14 -0500 Subject: [PATCH] Trying something diff, with only 1,5,9 reading --- setup.ps1 | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/setup.ps1 b/setup.ps1 index 15669ab..af4f848 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -65,7 +65,7 @@ do { Write-Host '' $answer = Read-Host 'Select number(s)' - } until ($answer -in @(1.2.3.4.5; 9)) + } until ($answer -in @(1..5; 9)) if ($answer -eq 9) { break } @@ -73,7 +73,7 @@ do { switch ( $answer ) { - '1' { + "1" { $apps = @( # BASE APPS @{name = 'Microsoft.PowerShell' }, @{name = 'Microsoft.VisualStudioCode' }, @@ -97,9 +97,28 @@ do { @{name = 'Microsoft.Office' }, @{name = 'Malwarebytes.Malwarebytes '} ) - InstallTheApps $Apps + + Foreach ($app in $apps) { + $listApp = winget list --exact -q $app.name + if (![String]::Join("", $listApp).Contains($app.name)) { + Write-host "Installing:" $app.name + if ($null -ne $app.source) { + winget install --exact $app.name --source $app.source + # winget install --exact --silent $app.name --source $app.source + } + else { + winget install --exact $app.name + # winget install --exact --silent $app.name + } + } + else { + Write-host "Skipping Install of " $app.name + } + } + + #InstallTheApps $Apps } - '2' { + "2" { $apps = @( # Game Launchers @{name = 'ElectronicArts.EADesktop' }, @{name = 'Valve.Steam' }, @@ -109,7 +128,7 @@ do { ) InstallTheApps $Apps } - '3' { + "3" { $apps = @( ## DESKTOP @{name = 'SteelSeries.SteelSeriesEngine' }, @{name = 'Corsair.iCUE.5' }, @@ -118,7 +137,7 @@ do { ) InstallTheApps $Apps } - '4' { $apps = @( ## LAPTOP + "4" { $apps = @( ## LAPTOP @{name = 'Intel.IntelDriverAndSupportAssistant' }, @{name = '9WZDNCRFJ4MV'; source = 'msstore' }, # Lenovo Vantage from MS Store @{name = 'j5create.Driver-JUA365' } ## Not sure if this is correct yet!