Attempt at a menu for install

This commit is contained in:
TheFlyingFool 2024-05-12 22:54:46 -05:00
parent c61b371959
commit 806b8d141d
2 changed files with 143 additions and 51 deletions

View File

@ -1,3 +1,3 @@
# Win_Setup # Win_Setup
Little powershell script that installs most of the windows programs I use Little PowerShell script that installs most of the windows programs I use

146
setup.ps1
View File

@ -39,6 +39,9 @@
#} #}
#Configure WinGet #Configure WinGet
do {
do {
Clear-Host ## Clear screen?
Write-Output "Configuring winget" Write-Output "Configuring winget"
#winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
@ -56,58 +59,147 @@ $settingsJson =
"@; "@;
$settingsJson | Out-File $settingsPath -Encoding utf8 $settingsJson | Out-File $settingsPath -Encoding utf8
#Install New apps write-host "1 - Base Apps"
Write-Output "Installing Apps" write-host "2 - Game Launchers"
$apps = @( write-host "3 - Desktop only"
write-host "4 - Lenovo Laptop only"
write-host "5 - Remove Crap"
write-host "9 - Exit"
write-host ""
$answer = read-host "Select number(s)"
$ok = $answer -match '[123459]+$'
if ( -not $ok) {write-host "Invalid selection"
Start-Sleep 2
write-host ""
}
} until ($ok)
switch -Regex ( $answer ) {
"1" { $apps = @( # BASE APPS
@{name = "Microsoft.PowerShell" }, @{name = "Microsoft.PowerShell" },
@{name = "Microsoft.VisualStudioCode" }, @{name = "Microsoft.VisualStudioCode" },
# @{name = "9WZDNCRFJ4MV"; source = "msstore" }, # Lenovo Vantage from MS Store
@{name = "Microsoft.PowerToys" }, @{name = "Microsoft.PowerToys" },
@{name = "Git.Git" }, @{name = "Git.Git" },
@{name = "Google.Chrome" }, @{name = "Google.Chrome" },
@{name = "Google.Drive"}, @{name = "Google.Drive"},
@{name = "Sinew.Enpass" }, @{name = "Hugo.Hugo.Extended"},
@{name = "Valve.Steam" }, @{name = "Bitwarden.Bitwarden"},
@{name = "Plex.Plex" }, @{name = "Plex.Plex" },
@{name = "ElectronicArts.EADesktop" }, #failed hash check on first test
# @{name = "Intel.IntelDriverAndSupportAssistant"},
@{name = "EpicGames.EpicGamesLauncher" },
@{name = "VivaldiTechnologies.Vivaldi" }, @{name = "VivaldiTechnologies.Vivaldi" },
@{name = "VideoLAN.VLC"}, @{name = "VideoLAN.VLC"},
@{name = "PointPlanck.FileBot"}, @{name = "PointPlanck.FileBot"},
@{name = "Oracle.VirtualBox"}, @{name = "Oracle.VirtualBox"},
@{name = "NordVPN.NordVPN"}, @{name = "NordVPN.NordVPN"},
# @{name = "Hashicorp.Vagrant"}, @{name = "Facebook.Messenger"},
@{name = "Microsoft.Office"}, #Failed hash check on first test @{name = "Microsoft.Office"}
@{name = "Facebook.Messenger"} )
# @{name = "SteelSeries.SteelSeriesEngine"}, ## Might want to link this to a second PS script? Foreach ($app in $apps) {
# @{name = "Corsair.iCUE.4"} ## Might want to link this to a second PS script?
);
Foreach ($app in $apps) {
$listApp = winget list --exact -q $app.name $listApp = winget list --exact -q $app.name
if (![String]::Join("", $listApp).Contains($app.name)) { if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name Write-host "Installing:" $app.name
if ($app.source -ne $null) { if ($null -ne $app.source) {
winget install --exact $app.name --source $app.source winget install --exact $app.name --source $app.source
# winget install --exact --silent $app.name --source $app.source # winget install --exact --silent $app.name --source $app.source
} }
else { else {
winget install --exact $app.name winget install --exact $app.name
# winget install --exact --silent $app.name # winget install --exact --silent $app.name
} }
} }
else { else {
Write-host "Skipping Install of " $app.name Write-host "Skipping Install of " $app.name
} }
}
}
"2" {
{ $apps = @( # Game Launchers
@{name = "ElectronicArts.EADesktop" },
@{name = "Valve.Steam" },
@{name = "EpicGames.EpicGamesLauncher" }
)
Foreach ($app in $apps) {
$listApp = winget list --exact -q $app.name
if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name
if ($app.source -ne $null) {
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
}
}
}
}
"3" {## DESKTOP
{ $apps = @(
@{name = "SteelSeries.SteelSeriesEngine"}, ## Might want to link this to a second PS script?
@{name = "Corsair.iCUE.4"} ## Might want to link this to a second PS script?
)
Foreach ($app in $apps) {
$listApp = winget list --exact -q $app.name
if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name
if ($app.source -ne $null) {
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
}
}
}
}
"4" {## LAPTOP
{ $apps = @(
@{name = "Intel.IntelDriverAndSupportAssistant"},
@{name = "9WZDNCRFJ4MV"; source = "msstore" } # Lenovo Vantage from MS Store
)
Foreach ($app in $apps) {
$listApp = winget list --exact -q $app.name
if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name
if ($app.source -ne $null) {
winget install --exact $app.name --source $app.source
}
else {
winget install --exact $app.name
}
}
else {
Write-host "Skipping Install of " $app.name
}
}
}
} }
"5" { ## REMOVE CRAP
#Remove Apps -- This section seems to need to run in an admin console! Write-Output "Removing Apps"
Write-Output "Removing Apps" $apps = "*3DPrint*", "Microsoft.MixedReality.Portal", "Disney.*" ,"Microsoft.BingNews*" ,"*BingWeather*","*.MicrosoftOfficeHub*" , "*MicrosoftSolitaireCollection*"
Foreach ($app in $apps)
$apps = "*3DPrint*", "Microsoft.MixedReality.Portal", "Disney.*" ,"Microsoft.BingNews*" ,"*BingWeather*", {
"*.MicrosoftOfficeHub*" , "*MicrosoftSolitaireCollection*" , "Microsoft.OneDrive"
Foreach ($app in $apps)
{
Write-host "Uninstalling:" $app Write-host "Uninstalling:" $app
Get-AppxPackage -allusers $app | Remove-AppxPackage Get-AppxPackage -allusers $app | Remove-AppxPackage
}
}
} }
} until ( $answer -match "9" )