-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.ps1
31 lines (26 loc) · 890 Bytes
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Param(
[string]$applist = "https://raw.githubusercontent.com/maheshrijal/windows-app-installer/main/applist"
)
try {
if ($applist -like "file:*") {
# Read the file from disk
$appListContent = Get-Content $applist
} else {
# Download the file from the web
$client = New-Object System.Net.WebClient
$appListContent = $client.DownloadString($applist)
}
# Convert the string to an array
$appListContent = $appListContent -split "`r?`n"
Write-Host "Install the following apps: $($appListContent -join ', ') Press any key to continue..."
# Wait for any key to continue
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
# Install the apps
foreach ($app in $appListContent) {
Write-Host "Installing app: $app"
winget.exe install -e --id $app
}
}
catch {
Write-Host "Error: $_"
}