From d272ac0c53e7b4bb54d122d1bc6cdeb352884c94 Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 13 May 2024 16:58:32 -0500 Subject: [PATCH] Trying something different --- setup.ps1 | 57 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/setup.ps1 b/setup.ps1 index af4f848..1613f9b 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -64,8 +64,9 @@ do { Write-Host '9 - Exit' Write-Host '' $answer = Read-Host 'Select number(s)' - - } until ($answer -in @(1..5; 9)) + + $ok =$answer -in @(1..5; 9) + } until ($ok) if ($answer -eq 9) { break } @@ -73,8 +74,7 @@ do { switch ( $answer ) { - "1" { - $apps = @( # BASE APPS + "1" { $apps = @( # BASE APPS @{name = 'Microsoft.PowerShell' }, @{name = 'Microsoft.VisualStudioCode' }, @{name = 'Microsoft.WindowsTerminal'}, @@ -97,7 +97,6 @@ do { @{name = 'Microsoft.Office' }, @{name = 'Malwarebytes.Malwarebytes '} ) - Foreach ($app in $apps) { $listApp = winget list --exact -q $app.name if (![String]::Join("", $listApp).Contains($app.name)) { @@ -126,7 +125,24 @@ do { @{name = 'GOG.Galaxy '}, @{name = 'Discord.Discord '} ) - 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 } "3" { $apps = @( ## DESKTOP @@ -135,15 +151,31 @@ do { @{name = 'Asus.ArmouryCrate '}, @{name = 'Nvidia.GeForceExperience '} ) - 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 } "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! ) - - Foreach ($app in $apps) { + Foreach ($app in $apps) { $listApp = winget list --exact -q $app.name if (![String]::Join("", $listApp).Contains($app.name)) { Write-host "Installing:" $app.name @@ -159,10 +191,11 @@ do { else { Write-host "Skipping Install of " $app.name } - } - } + #InstallTheApps $Apps - + } + } + '5' { ## REMOVE CRAP Write-Output 'Removing Apps'