Compare commits
3 Commits
07c52cd99c
...
9f9ade13b4
Author | SHA1 | Date | |
---|---|---|---|
9f9ade13b4 | |||
dbf1dfa6fc | |||
fd11d88c8c |
13
README.md
13
README.md
@ -1,4 +1,6 @@
|
|||||||
# Win_Setup #
|
# README #
|
||||||
|
|
||||||
|
## About "Project" ##
|
||||||
|
|
||||||
Little PowerShell script that installs most of the windows programs I use
|
Little PowerShell script that installs most of the windows programs I use
|
||||||
|
|
||||||
@ -8,15 +10,16 @@ based on:
|
|||||||
* <https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c>
|
* <https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c>
|
||||||
* <https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901>
|
* <https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901>
|
||||||
|
|
||||||
# Useage: #
|
## Usage ##
|
||||||
|
|
||||||
|
### FIRST ###
|
||||||
|
|
||||||
## FIRST ##
|
|
||||||
Run `winget search`
|
Run `winget search`
|
||||||
|
|
||||||
## Second ##
|
### Second ###
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://git.theflyingfool.com/theflyingfool/Win_Setup/raw/branch/main/setup.ps1'))"
|
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://git.theflyingfool.com/theflyingfool/Win_Setup/raw/branch/main/setup.ps1'))"
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll get 5 menu options. Use the ones that make sense.
|
You'll get 5 menu options. Use the ones that make sense.
|
||||||
|
15
setup.ps1
15
setup.ps1
@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
## NOT TESTED ##
|
||||||
|
|
||||||
|
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
|
||||||
|
|
||||||
#Install WinGet
|
#Install WinGet
|
||||||
## WinGet should be on any windows 11 install by default
|
## WinGet should be on any windows 11 install by default
|
||||||
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
|
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
|
||||||
@ -97,7 +102,8 @@ do {
|
|||||||
@{name = 'Microsoft.Office' },
|
@{name = 'Microsoft.Office' },
|
||||||
@{name = 'Malwarebytes.Malwarebytes '}
|
@{name = 'Malwarebytes.Malwarebytes '}
|
||||||
)
|
)
|
||||||
Foreach ($app in $apps) {
|
<#
|
||||||
|
# { 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
|
||||||
@ -114,8 +120,9 @@ do {
|
|||||||
Write-host "Skipping Install of " $app.name
|
Write-host "Skipping Install of " $app.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
:Enter a comment or description}
|
||||||
#InstallTheApps $Apps
|
#>
|
||||||
|
InstallTheApps $Apps
|
||||||
}
|
}
|
||||||
"2" {
|
"2" {
|
||||||
$apps = @( # Game Launchers
|
$apps = @( # Game Launchers
|
||||||
@ -195,7 +202,7 @@ do {
|
|||||||
#InstallTheApps $Apps
|
#InstallTheApps $Apps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
'5' {
|
'5' {
|
||||||
## REMOVE CRAP
|
## REMOVE CRAP
|
||||||
Write-Output 'Removing Apps'
|
Write-Output 'Removing Apps'
|
||||||
|
161
testbed.ps1
Normal file
161
testbed.ps1
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
#Install WinGet
|
||||||
|
## WinGet should be on any windows 11 install by default
|
||||||
|
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
|
||||||
|
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
|
||||||
|
"Installing winget Dependencies"
|
||||||
|
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
|
||||||
|
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
$releases = Invoke-RestMethod -uri $releases_url
|
||||||
|
$latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1
|
||||||
|
"Installing winget from $($latestRelease.browser_download_url)"
|
||||||
|
Add-AppxPackage -Path $latestRelease.browser_download_url
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
"winget already installed"
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
do {
|
||||||
|
#Configure WinGet
|
||||||
|
Write-Output "Configuring winget"
|
||||||
|
#winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
|
||||||
|
$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
|
||||||
|
$settingsJson =
|
||||||
|
@"
|
||||||
|
{
|
||||||
|
// For documentation on these settings, see: https://aka.ms/winget-settings
|
||||||
|
"installBehavior": {
|
||||||
|
"preferences": {
|
||||||
|
"scope": "machine"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"@;
|
||||||
|
$settingsJson | Out-File $settingsPath -Encoding utf8
|
||||||
|
write-host "1 - Base Apps"
|
||||||
|
write-host "2 - Game Launchers"
|
||||||
|
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.VisualStudioCode" },
|
||||||
|
@{name = "Microsoft.PowerToys" },
|
||||||
|
@{name = "Git.Git" },
|
||||||
|
@{name = "Google.Chrome" },
|
||||||
|
@{name = "Google.Drive"},
|
||||||
|
@{name = "Hugo.Hugo.Extended"},
|
||||||
|
@{name = "Bitwarden.Bitwarden"},
|
||||||
|
@{name = "Plex.Plex" },
|
||||||
|
@{name = "VivaldiTechnologies.Vivaldi" },
|
||||||
|
@{name = "VideoLAN.VLC"},
|
||||||
|
@{name = "PointPlanck.FileBot"},
|
||||||
|
@{name = "Oracle.VirtualBox"},
|
||||||
|
@{name = "NordVPN.NordVPN"},
|
||||||
|
@{name = "Facebook.Messenger"},
|
||||||
|
@{name = "Microsoft.Office"}
|
||||||
|
)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"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 ($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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"3" { $apps = @( ## DESKTOP
|
||||||
|
@{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 ($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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"4" { $apps = @( ## LAPTOP
|
||||||
|
@{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 ($null -ne $app.source) {
|
||||||
|
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
|
||||||
|
Write-Output "Removing Apps"
|
||||||
|
$apps = "*3DPrint*", "Microsoft.MixedReality.Portal", "Disney.*" ,"Microsoft.BingNews*" ,"*BingWeather*","*.MicrosoftOfficeHub*" , "*MicrosoftSolitaireCollection*"
|
||||||
|
Foreach ($app in $apps)
|
||||||
|
{
|
||||||
|
Write-host "Uninstalling:" $app
|
||||||
|
Get-AppxPackage -allusers $app | Remove-AppxPackage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} until ( $answer -match "9" )
|
Loading…
Reference in New Issue
Block a user