-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork.ps1
More file actions
31 lines (26 loc) · 960 Bytes
/
work.ps1
File metadata and controls
31 lines (26 loc) · 960 Bytes
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
# Winget UI - Simple package installer
$ErrorActionPreference = "Stop"
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
# Load modules
. "$dir\modules\config-loader.ps1"
. "$dir\modules\profile-selector.ps1"
. "$dir\modules\package-selector.ps1"
. "$dir\modules\installer.ps1"
# Get config (returns parsed JSON if --config, or profiles array otherwise)
$result = Get-ProfileConfig -ScriptArgs $args -ScriptDir $dir
if ($result -is [array]) {
# No --config flag - show profile selector
$selected_file = Show-ProfileSelector -Profiles $result
$profile_config = Get-Content $selected_file -Raw | ConvertFrom-Json
} else {
$profile_config = $result
}
# Build items and show package selector
$items = Get-PackageItems -ProfileConfig $profile_config
# Main loop
while ($true) {
$queue = Show-PackageSelector -Items $items -ProfileName $profile_config.name
if ($queue.Count -gt 0) {
Start-Installation -Queue $queue
}
}