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!