Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ always work. Proxmox tools: `therepos/proxmox`; MCP servers: `therepos/mcp`; Cla
- `elevate`: `if (-not (Test-Admin)) { Start-Elevated $ScriptUrl; return }`, only when admin is needed;
`-NoExit` for one-shot scripts whose output must stay. Re-runs the bootstrap, or the local copy when
started from a shortcut, in an admin Windows Terminal window (Windows ignores the default-terminal
setting for admin windows); classic console when Terminal is missing.
setting for admin windows); classic console when Terminal is missing. Once it opens, the original
window closes (only one window at a time); if the admin prompt is refused, it stays with `Cancelled.`
- `layout`: `Set-WindowRight` at top level before the first screen (after the elevate check, never in a
hidden or scheduled run) puts the window on the right half of its screen.
- `shortcut`: every script with a menu offers Settings > `Shortcut '<name>' [on/off]`. It saves a local
Expand Down
12 changes: 10 additions & 2 deletions apps/agentprofiler.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ function Start-Elevated([string]$ScriptUrl, [switch]$NoExit) {
}
}
}
if (-not $opened) { Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs }
Write-Host " Continue in the new (elevated) window. You can close this one." -ForegroundColor Gray
if (-not $opened) {
try {
Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs -ErrorAction Stop
} catch {
Write-Host " Cancelled." -ForegroundColor Yellow
return
}
}
# Only the admin window stays open
[Environment]::Exit(0)
}
# <<< elevate
$IsAdmin = Test-Admin
Expand Down
12 changes: 10 additions & 2 deletions apps/appupdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,16 @@ function Start-Elevated([string]$ScriptUrl, [switch]$NoExit) {
}
}
}
if (-not $opened) { Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs }
Write-Host " Continue in the new (elevated) window. You can close this one." -ForegroundColor Gray
if (-not $opened) {
try {
Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs -ErrorAction Stop
} catch {
Write-Host " Cancelled." -ForegroundColor Yellow
return
}
}
# Only the admin window stays open
[Environment]::Exit(0)
}
# <<< elevate
$IsAdmin = Test-Admin
Expand Down
12 changes: 10 additions & 2 deletions apps/hibernate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ function Start-Elevated([string]$ScriptUrl, [switch]$NoExit) {
}
}
}
if (-not $opened) { Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs }
Write-Host " Continue in the new (elevated) window. You can close this one." -ForegroundColor Gray
if (-not $opened) {
try {
Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs -ErrorAction Stop
} catch {
Write-Host " Cancelled." -ForegroundColor Yellow
return
}
}
# Only the admin window stays open
[Environment]::Exit(0)
}
# <<< elevate
$IsAdmin = Test-Admin
Expand Down
12 changes: 10 additions & 2 deletions apps/systeminfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ function Start-Elevated([string]$ScriptUrl, [switch]$NoExit) {
}
}
}
if (-not $opened) { Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs }
Write-Host " Continue in the new (elevated) window. You can close this one." -ForegroundColor Gray
if (-not $opened) {
try {
Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs -ErrorAction Stop
} catch {
Write-Host " Cancelled." -ForegroundColor Yellow
return
}
}
# Only the admin window stays open
[Environment]::Exit(0)
}
# <<< elevate
$IsAdmin = Test-Admin
Expand Down
14 changes: 11 additions & 3 deletions scripts/sync-blocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ BLOCK

# elevate: re-run this script as admin, in Windows Terminal when installed (Windows ignores
# the default-terminal setting for admin windows). From GitHub it re-runs the bootstrap, from a
# file (shortcut) that file. -NoExit keeps the admin window open after a one-shot script.
# file (shortcut) that file, then closes this window. -NoExit keeps the admin window open after a one-shot script.
# shellcheck disable=SC2034 # read via ${!var} below
BLOCK_elevate=$(cat <<'BLOCK'
function Test-Admin {
Expand Down Expand Up @@ -97,8 +97,16 @@ function Start-Elevated([string]$ScriptUrl, [switch]$NoExit) {
}
}
}
if (-not $opened) { Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs }
Write-Host " Continue in the new (elevated) window. You can close this one." -ForegroundColor Gray
if (-not $opened) {
try {
Start-Process -FilePath 'powershell.exe' -Verb RunAs -ArgumentList $psArgs -ErrorAction Stop
} catch {
Write-Host " Cancelled." -ForegroundColor Yellow
return
}
}
# Only the admin window stays open
[Environment]::Exit(0)
}
BLOCK
)
Expand Down
Loading