commit 1ce0d6a799a566f4a42d4e28fef3abff8974528e Author: Roland Date: Sat Oct 31 15:08:16 2026 +0100 initial Version Co-Authored-By: Claude Opus 5.5 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ecb669f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto +*.ps1 text eol=crlf +*.cmd text eol=crlf +*.txt text eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9262df4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# ViVeTool selbst (separat herunterladen: https://github.com/thebookisclosed/ViVe/releases) +ViVeTool.exe +*.dll +FeatureDictionary.pfs + +# Backups der Feature-Konfiguration +*.bin diff --git a/EigeneNamen.txt b/EigeneNamen.txt new file mode 100644 index 0000000..30b2a3a --- /dev/null +++ b/EigeneNamen.txt @@ -0,0 +1,2 @@ +# Eigene Namen/Beschreibungen fuer Features: ID = Beschreibung +60813048 = Explorer-Kontextmenü: Option "Anpassen" diff --git a/Favoriten.txt b/Favoriten.txt new file mode 100644 index 0000000..0a6fcb6 --- /dev/null +++ b/Favoriten.txt @@ -0,0 +1,2 @@ +# Favoriten: eine Feature-ID pro Zeile, Kommentare mit # +60813048 # Explorer-Kontextmenü: Option "Anpassen" diff --git a/README.md b/README.md new file mode 100644 index 0000000..d14b4aa --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# ViVeTool Feature-Manager + +Ein PowerShell-Menü für [ViVeTool](https://github.com/thebookisclosed/ViVe), mit dem sich versteckte Windows-Features +suchen, anzeigen, aktivieren und deaktivieren lassen. + +## Einrichtung + +1. ViVeTool von den [Releases](https://github.com/thebookisclosed/ViVe/releases) herunterladen. +2. `ViVeTool.exe`, `Albacore.ViVe.dll`, `Newtonsoft.Json.dll` und `FeatureDictionary.pfs` in diesen Ordner kopieren. +3. `ViVeMenu.cmd` doppelklicken. Das Skript fordert selbst Administratorrechte an. + +## Funktionen + +- Features nach Name, ID oder eigenem Namen suchen +- Alle konfigurierten, alle aktiven oder nur die selbst geänderten Features anzeigen +- Ein oder mehrere Features aktivieren, deaktivieren, umschalten oder zurücksetzen (Auswahl z. B. `1,4,7` oder `2-6`) +- Aktivieren mit Variante +- Favoriten (`Favoriten.txt`) +- Eigene Namen für Features (`EigeneNamen.txt`): werden vor dem offiziellen Namen angezeigt, + der offizielle Name steht in Klammern dahinter +- Backup der Feature-Konfiguration exportieren und importieren + +## Dateien + +| Datei | Inhalt | +|---|---| +| `ViVeMenu.cmd` | Starter | +| `ViVeMenu.ps1` | Das Menü | +| `EigeneNamen.txt` | Eigene Namen, Format `ID = Name` | +| `Favoriten.txt` | Favoriten, eine ID pro Zeile, Kommentare mit `#` | + +Hinweis: Viele Änderungen werden erst nach einem Neustart wirksam. diff --git a/ViVeMenu.cmd b/ViVeMenu.cmd new file mode 100644 index 0000000..9b2ad66 --- /dev/null +++ b/ViVeMenu.cmd @@ -0,0 +1,2 @@ +@echo off +powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0ViVeMenu.ps1" diff --git a/ViVeMenu.ps1 b/ViVeMenu.ps1 new file mode 100644 index 0000000..beede79 --- /dev/null +++ b/ViVeMenu.ps1 @@ -0,0 +1,459 @@ +<# + ViVeTool Feature-Manager + Menue zum Anzeigen, Suchen, Aktivieren und Deaktivieren von Windows-Features + ueber ViVeTool.exe (muss im selben Ordner liegen). + + Start: ViVeMenu.cmd doppelklicken (startet automatisch als Administrator) +#> + +$ErrorActionPreference = 'Stop' + +$ScriptPath = $MyInvocation.MyCommand.Path +$Root = Split-Path -Parent $ScriptPath +$Vive = Join-Path $Root 'ViVeTool.exe' +$DictFile = Join-Path $Root 'FeatureDictionary.pfs' +$FavFile = Join-Path $Root 'Favoriten.txt' +$NotesFile = Join-Path $Root 'EigeneNamen.txt' +$PageSize = 25 + +# ------------------------------------------------------------------ Admin-Rechte +$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Host 'Starte neu mit Administratorrechten ...' -ForegroundColor Yellow + Start-Process powershell.exe -Verb RunAs -ArgumentList @( + '-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', "`"$ScriptPath`"" + ) + exit +} + +if (-not (Test-Path $Vive)) { + Write-Host "ViVeTool.exe nicht gefunden in: $Root" -ForegroundColor Red + Read-Host 'Enter zum Beenden' + exit 1 +} + +$Host.UI.RawUI.WindowTitle = 'ViVeTool Feature-Manager' + +# ------------------------------------------------------------------ Daten +$script:Names = @{} # Id -> Name (aus FeatureDictionary.pfs + Query) +$script:States = @{} # Id -> Objekt (wirksame Konfiguration = hoechste Prioritaet) +$script:Notes = @{} # Id -> eigene Beschreibung (aus EigeneNamen.txt) + +# EigeneNamen.txt: eine Zeile pro Feature im Format ID = Beschreibung +function Load-Notes { + $script:Notes = @{} + if (-not (Test-Path $NotesFile)) { return } + foreach ($line in (Get-Content $NotesFile -Encoding UTF8)) { + if ($line -match '^\s*(\d+)\s*=\s*(.*?)\s*$' -and $matches[2]) { $script:Notes[$matches[1]] = $matches[2] } + } +} + +function Set-Note([string]$id, [string]$text) { + if ($text) { $script:Notes[$id] = $text } else { $script:Notes.Remove($id) } + $out = @('# Eigene Namen/Beschreibungen fuer Features: ID = Beschreibung') + $out += @($script:Notes.Keys | Sort-Object { [long]$_ } | ForEach-Object { '{0} = {1}' -f $_, $script:Notes[$_] }) + Set-Content -Path $NotesFile -Encoding UTF8 -Value $out +} + +function Load-Dictionary { + if (-not (Test-Path $DictFile)) { return } + foreach ($line in [IO.File]::ReadLines($DictFile)) { + $i = $line.LastIndexOf(',') + if ($i -gt 0) { + $id = $line.Substring($i + 1).Trim() + if ($id -match '^\d+$') { $script:Names[$id] = $line.Substring(0, $i) } + } + } +} + +# Wertet die Ausgabe von "ViVeTool /query" aus. +# Liefert pro Feature-ID nur den Eintrag mit der hoechsten Prioritaet (= wirksamer Zustand). +function Parse-Query([string[]]$lines) { + $result = @{} + $cur = $null + $flush = { + if ($cur) { + $old = $result[$cur.Id] + if ($cur.Priority -eq 8) { $cur.UserSet = $true } + if (-not $old) { $result[$cur.Id] = $cur } + else { + $userSet = $old.UserSet -or $cur.UserSet + if ($cur.Priority -gt $old.Priority) { $result[$cur.Id] = $cur } + $result[$cur.Id].UserSet = $userSet + } + } + } + foreach ($l in $lines) { + if ($l -match '^\[(\d+)\](?:\s+\((.+)\))?') { + . $flush + $cur = [pscustomobject]@{ + Id = $matches[1]; Name = $matches[2]; Priority = -1; PriorityName = '' + State = 'Default'; Type = ''; Variant = $null; UserSet = $false + } + if ($cur.Name) { $script:Names[$cur.Id] = $cur.Name } + } + elseif ($cur) { + if ($l -match '^Priority\s*:\s*(.*)$') { + $p = $matches[1].Trim() + if ($p -match '^(\w+)\s*\((\d+)\)') { $cur.PriorityName = $matches[1]; $cur.Priority = [int]$matches[2] } + elseif ($p -match '^(\d+)$') { $cur.PriorityName = $p; $cur.Priority = [int]$p } + } + elseif ($l -match '^State\s*:\s*(\w+)') { $cur.State = $matches[1] } + elseif ($l -match '^Type\s*:\s*(\w+)') { $cur.Type = $matches[1] } + elseif ($l -match '^Variant\s*:\s*(\d+)') { $cur.Variant = $matches[1] } + } + } + . $flush + return $result +} + +function Load-AllStates { + Write-Host 'Lese aktuelle Feature-Konfiguration (dauert einige Sekunden) ...' -ForegroundColor DarkGray + $script:States = Parse-Query (& $Vive /query) +} + +# Aktualisiert nur einzelne IDs (schnell) +function Refresh-States([string[]]$ids) { + $list = $ids -join ',' + $eff = Parse-Query (& $Vive /query "/id:$list") + $usr = Parse-Query (& $Vive /query "/id:$list" /priority:user) + foreach ($id in $ids) { + if ($eff.ContainsKey($id)) { + $eff[$id].UserSet = $usr.ContainsKey($id) + $script:States[$id] = $eff[$id] + } + else { $script:States.Remove($id) } + } +} + +function Get-Feature([string]$id) { + $s = $script:States[$id] + [pscustomobject]@{ + Id = $id + Name = if ($script:Names.ContainsKey($id)) { $script:Names[$id] } else { '' } + State = if ($s) { $s.State } else { 'Default' } + Priority = if ($s) { $s.PriorityName } else { '' } + Variant = if ($s) { $s.Variant } else { $null } + UserSet = if ($s) { $s.UserSet } else { $false } + Note = if ($script:Notes.ContainsKey($id)) { $script:Notes[$id] } else { '' } + Display = Get-DisplayName $id + } +} + +# Anzeige: eigener Name zuerst, offizieller Name in Klammern dahinter +function Get-DisplayName([string]$id) { + $own = $script:Notes[$id]; $off = $script:Names[$id] + if ($own -and $off) { "$own ($off)" } elseif ($own) { $own } else { $off } +} + +# Schreibt den Namen farbig: eigener Name in Cyan, offizieller Name (in Klammern) grau +function Write-FeatureName($f, [int]$maxLen = 0) { + $own = $f.Note; $off = $f.Name + if ($maxLen -gt 0) { + if ($own -and $own.Length -gt $maxLen) { $own = $own.Substring(0, $maxLen - 3) + '...'; $off = '' } + $rest = $maxLen - $(if ($own) { $own.Length + 3 } else { 0 }) + if ($off -and $off.Length -gt $rest) { $off = if ($rest -gt 6) { $off.Substring(0, $rest - 3) + '...' } else { '' } } + } + if ($own) { + Write-Host $own -NoNewline -ForegroundColor Cyan + if ($off) { Write-Host " ($off)" -NoNewline -ForegroundColor DarkGray } + } + else { Write-Host $off -NoNewline } +} + +function Edit-OwnName([string]$id) { + $f = Get-Feature $id + Write-Host '' + Write-Host " Feature-ID : $id" + Write-Host " Offizieller Name: $(if ($f.Name) { $f.Name } else { '(keiner bekannt)' })" + Write-Host " Eigener Name : $(if ($f.Note) { $f.Note } else { '(keiner)' })" + $t = (Read-Host 'Neuer eigener Name (Enter = unveraendert, - = loeschen)').Trim() + if ($t -eq '') { return } + if ($t -eq '-') { Set-Note $id ''; Write-Host ' Eigener Name geloescht.' -ForegroundColor Yellow } + else { Set-Note $id $t; Write-Host ' Gespeichert.' -ForegroundColor Green } +} + +# ------------------------------------------------------------------ Favoriten +function Get-Favorites { + if (-not (Test-Path $FavFile)) { return @() } + @(Get-Content $FavFile | ForEach-Object { ($_ -split '#')[0].Trim() } | Where-Object { $_ -match '^\d+$' } | Select-Object -Unique) +} + +function Toggle-Favorites([string[]]$ids) { + if (-not (Test-Path $FavFile)) { + Set-Content -Path $FavFile -Encoding UTF8 -Value '# Favoriten: eine Feature-ID pro Zeile, Kommentare mit #' + } + $lines = [System.Collections.Generic.List[string]](Get-Content $FavFile) + foreach ($id in $ids) { + $idx = -1 + for ($i = 0; $i -lt $lines.Count; $i++) { if (($lines[$i] -split '#')[0].Trim() -eq $id) { $idx = $i; break } } + if ($idx -ge 0) { $lines.RemoveAt($idx); Write-Host " Favorit entfernt: $id" -ForegroundColor Yellow } + else { + $n = (Get-Feature $id).Display + $lines.Add(("{0} # {1}" -f $id, $n).TrimEnd(' ', '#')) + Write-Host " Favorit hinzugefuegt: $id $n" -ForegroundColor Green + } + } + Set-Content -Path $FavFile -Encoding UTF8 -Value $lines +} + +# ------------------------------------------------------------------ ViVeTool-Aktionen +function Invoke-Vive([string]$action, [string[]]$ids, [string]$variant) { + if (-not $ids -or $ids.Count -eq 0) { return } + $vargs = @("/$action", "/id:$($ids -join ',')") + if ($variant) { $vargs += "/variant:$variant" } + Write-Host '' + Write-Host "> ViVeTool $($vargs -join ' ')" -ForegroundColor DarkGray + & $Vive @vargs | Where-Object { $_ -and $_ -notmatch '^ViVeTool v' } | ForEach-Object { Write-Host " $_" } + if ($LASTEXITCODE -ne 0) { Write-Host " Fehlercode: $LASTEXITCODE" -ForegroundColor Red } + Refresh-States $ids + Write-Host ' Hinweis: Manche Aenderungen werden erst nach einem Neustart wirksam.' -ForegroundColor DarkYellow +} + +function Do-Action([string[]]$ids) { + Write-Host '' + Write-Host "Ausgewaehlt: $($ids -join ', ')" + Write-Host '[A] Aktivieren [D] Deaktivieren [U] Umschalten [R] Zuruecksetzen (Standard)' + Write-Host '[V] Aktivieren mit Variante [F] Favorit an/aus [E] Eigenen Namen bearbeiten [Enter] Abbrechen' + $c = (Read-Host 'Aktion').Trim().ToUpper() + switch ($c) { + 'A' { Invoke-Vive 'enable' $ids } + 'D' { Invoke-Vive 'disable' $ids } + 'R' { Invoke-Vive 'reset' $ids } + 'V' { + $v = Read-Host 'Variante (0-63)' + if ($v -match '^\d+$' -and [int]$v -le 63) { Invoke-Vive 'enable' $ids $v } else { Write-Host 'Ungueltige Variante.' -ForegroundColor Red } + } + 'U' { + $on = @($ids | Where-Object { (Get-Feature $_).State -eq 'Enabled' }) + $off = @($ids | Where-Object { (Get-Feature $_).State -ne 'Enabled' }) + if ($off.Count) { Invoke-Vive 'enable' $off } + if ($on.Count) { Invoke-Vive 'disable' $on } + } + 'F' { Toggle-Favorites $ids } + { $_ -in 'E', 'B' } { + foreach ($id in $ids) { Edit-OwnName $id } + return + } + default { return } + } + Read-Host 'Enter zum Fortfahren' | Out-Null +} + +# "1,3,5-8" -> 1,3,5,6,7,8 +function Parse-Selection([string]$text, [int]$max) { + $nums = @() + foreach ($part in ($text -split '[,; ]+' | Where-Object { $_ })) { + if ($part -match '^(\d+)-(\d+)$') { $nums += [int]$matches[1]..[int]$matches[2] } + elseif ($part -match '^\d+$') { $nums += [int]$part } + else { return $null } + } + @($nums | Where-Object { $_ -ge 1 -and $_ -le $max } | Select-Object -Unique) +} + +# ------------------------------------------------------------------ Anzeige +function Write-StateCell([string]$state) { + switch ($state) { + 'Enabled' { Write-Host ('{0,-11}' -f 'AKTIV') -NoNewline -ForegroundColor Green } + 'Disabled' { Write-Host ('{0,-11}' -f 'INAKTIV') -NoNewline -ForegroundColor Red } + default { Write-Host ('{0,-11}' -f 'Standard') -NoNewline -ForegroundColor DarkGray } + } +} + +function Write-Header([string]$title) { + Clear-Host + Write-Host '==============================================================================' -ForegroundColor Cyan + Write-Host " ViVeTool Feature-Manager - $title" -ForegroundColor Cyan + Write-Host '==============================================================================' -ForegroundColor Cyan +} + +# Blaetterbare Liste mit Auswahl +function Show-FeatureList([string]$title, [scriptblock]$getIds) { + $page = 0 + $filter = '' + while ($true) { + $all = @(& $getIds) + # @(...) ist wichtig: sonst wird eine Liste mit nur 1 Eintrag zu einem einzelnen String + # und $ids[0] liefert nur das erste Zeichen der ID. + $ids = @(if ($filter) { + $all | Where-Object { $f = Get-Feature $_; $_ -like "*$filter*" -or $f.Name -like "*$filter*" -or $f.Note -like "*$filter*" } + } else { $all }) + + $pages = [Math]::Max(1, [Math]::Ceiling($ids.Count / $PageSize)) + if ($page -ge $pages) { $page = $pages - 1 } + if ($page -lt 0) { $page = 0 } + + $t = $title; if ($filter) { $t += " (Filter: $filter)" } + Write-Header $t + Write-Host (" {0} Eintraege - Seite {1}/{2}" -f $ids.Count, ($page + 1), $pages) -ForegroundColor DarkGray + Write-Host '' + Write-Host (' {0,4} {1,-10} {2,-11} {3}' -f 'Nr', 'ID', 'Status', 'Name') -ForegroundColor White + Write-Host ' ---- ---------- ----------- ----------------------------------------------' -ForegroundColor DarkGray + + $start = $page * $PageSize + $end = [Math]::Min($start + $PageSize, $ids.Count) - 1 + if ($ids.Count -eq 0) { Write-Host ' (keine Eintraege)' -ForegroundColor DarkGray } + else { + for ($i = $start; $i -le $end; $i++) { + $f = Get-Feature $ids[$i] + Write-Host (' {0,4} {1,-10} ' -f ($i + 1), $f.Id) -NoNewline + Write-StateCell $f.State + $extra = '' + if ($f.Variant) { $extra += " [V$($f.Variant)]" } + if ($f.UserSet) { $extra += ' *' } + Write-FeatureName $f 52 + Write-Host $extra + } + } + Write-Host '' + Write-Host ' * = von dir gesetzt (User-Prioritaet) ' -NoNewline -ForegroundColor DarkGray + Write-Host 'Eigener Name' -NoNewline -ForegroundColor Cyan + Write-Host ' (offizieller Name)' -ForegroundColor DarkGray + Write-Host ' Nummer(n) waehlen, z.B. 3 oder 1,4,7 oder 2-6' -ForegroundColor Gray + Write-Host ' [N] naechste Seite [P] vorherige Seite [F] Filter [Z] zurueck' -ForegroundColor Gray + $in = (Read-Host 'Eingabe').Trim() + + switch -Regex ($in.ToUpper()) { + '^N$' { $page++; continue } + '^P$' { $page--; continue } + '^F$' { $filter = (Read-Host 'Filtertext (leer = Filter aus)').Trim(); $page = 0; continue } + '^(Z|Q|0)?$' { if ($in -eq '' ) { continue } else { return } } + default { + $sel = Parse-Selection $in $ids.Count + if ($sel -and $sel.Count) { Do-Action @($sel | ForEach-Object { $ids[$_ - 1] }) } + else { Write-Host 'Ungueltige Eingabe.' -ForegroundColor Red; Start-Sleep -Milliseconds 800 } + } + } + } +} + +# ------------------------------------------------------------------ Menuepunkte +function Menu-Search { + $term = (Read-Host 'Suchbegriff (Teil des Namens oder ID)').Trim() + if (-not $term) { return } + $ids = @($script:Names.Keys | Where-Object { $_ -like "*$term*" -or $script:Names[$_] -like "*$term*" }) + $ids += @($script:States.Keys | Where-Object { $_ -like "*$term*" -and -not $script:Names.ContainsKey($_) }) + $ids += @($script:Notes.Keys | Where-Object { $script:Notes[$_] -like "*$term*" }) + $ids = @($ids | Sort-Object { Get-DisplayName $_ }, { [long]$_ } -Unique) + if ($ids.Count -eq 0 -and $term -match '^\d+$') { $ids = @($term) } # unbekannte ID trotzdem anbieten + $script:tmpIds = $ids + Show-FeatureList "Suche: $term" { $script:tmpIds } +} + +function Menu-Direct { + $text = (Read-Host 'Feature-ID(s), mehrere mit Komma getrennt').Trim() + $ids = @($text -split '[,; ]+' | Where-Object { $_ -match '^\d+$' } | Select-Object -Unique) + if ($ids.Count -eq 0) { return } + Refresh-States $ids + foreach ($id in $ids) { + $f = Get-Feature $id + Write-Host (' {0,-10} ' -f $f.Id) -NoNewline; Write-StateCell $f.State; Write-FeatureName $f; Write-Host '' + } + Do-Action $ids +} + +function Menu-OwnNames { + while ($true) { + Write-Header 'Eigene Namen' + Write-Host " $($script:Notes.Count) eigene Namen gespeichert in: $NotesFile" -ForegroundColor DarkGray + Write-Host '' + Write-Host ' [1] Eigene Namen anzeigen / bearbeiten' + Write-Host ' [2] Neuen eigenen Namen fuer eine Feature-ID vergeben' + Write-Host ' [3] Datei im Editor oeffnen' + Write-Host '' + Write-Host ' [0] Zurueck' + switch ((Read-Host 'Auswahl').Trim()) { + '1' { Show-FeatureList 'Eigene Namen' { $script:Notes.Keys | Sort-Object { $script:Notes[$_] } } } + '2' { + $id = (Read-Host 'Feature-ID').Trim() + if ($id -match '^\d+$') { Edit-OwnName $id; Read-Host 'Enter zum Fortfahren' | Out-Null } + elseif ($id) { Write-Host 'Ungueltige ID.' -ForegroundColor Red; Start-Sleep 1 } + } + '3' { + if (-not (Test-Path $NotesFile)) { Set-Note '0' '' } # legt die Datei mit Kopfzeile an + Start-Process notepad.exe -ArgumentList "`"$NotesFile`"" -Wait + Load-Notes + } + '0' { return } + '' { return } + } + } +} + +function Menu-Export { + $default = Join-Path $Root ("Backup_{0:yyyy-MM-dd_HHmmss}.bin" -f (Get-Date)) + $file = (Read-Host "Dateiname [$default]").Trim() + if (-not $file) { $file = $default } + & $Vive /export "/filename:$file" | Where-Object { $_ -and $_ -notmatch '^ViVeTool v' } | ForEach-Object { Write-Host " $_" } + Read-Host 'Enter zum Fortfahren' | Out-Null +} + +function Menu-Import { + $backups = @(Get-ChildItem -Path $Root -Filter '*.bin' -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending) + for ($i = 0; $i -lt $backups.Count; $i++) { Write-Host (' [{0}] {1}' -f ($i + 1), $backups[$i].Name) } + $in = (Read-Host 'Nummer oder vollstaendiger Pfad').Trim() + if (-not $in) { return } + $file = if ($in -match '^\d+$' -and [int]$in -ge 1 -and [int]$in -le $backups.Count) { $backups[[int]$in - 1].FullName } else { $in } + if (-not (Test-Path $file)) { Write-Host 'Datei nicht gefunden.' -ForegroundColor Red; Start-Sleep 1; return } + & $Vive /import "/filename:$file" | Where-Object { $_ -and $_ -notmatch '^ViVeTool v' } | ForEach-Object { Write-Host " $_" } + Load-AllStates + Read-Host 'Enter zum Fortfahren' | Out-Null +} + +function Menu-FullReset { + Write-Host '' + Write-Host 'ACHTUNG: Entfernt ALLE benutzerdefinierten Feature-Konfigurationen!' -ForegroundColor Red + Write-Host 'Tipp: Vorher ein Backup exportieren (Menuepunkt 7).' -ForegroundColor Yellow + if ((Read-Host 'Zum Bestaetigen JA eingeben') -ceq 'JA') { + & $Vive /fullreset | Where-Object { $_ -and $_ -notmatch '^ViVeTool v' } | ForEach-Object { Write-Host " $_" } + Load-AllStates + Read-Host 'Enter zum Fortfahren' | Out-Null + } +} + +# ------------------------------------------------------------------ Hauptprogramm +Write-Header 'Start' +Write-Host 'Lade Feature-Woerterbuch ...' -ForegroundColor DarkGray +Load-Dictionary +Load-Notes +Load-AllStates + +while ($true) { + $userCount = @($script:States.Values | Where-Object { $_.UserSet }).Count + Write-Header 'Hauptmenue' + Write-Host (" {0} Feature-Namen bekannt, {1} Features konfiguriert, {2} davon von dir gesetzt" -f ` + $script:Names.Count, $script:States.Count, $userCount) -ForegroundColor DarkGray + Write-Host '' + Write-Host ' [1] Features suchen (Name oder ID)' + Write-Host ' [2] Alle konfigurierten Features anzeigen' + Write-Host ' [3] Nur aktive Features anzeigen' + Write-Host ' [4] Von dir geaenderte Features anzeigen' + Write-Host ' [5] Favoriten' + Write-Host ' [6] Feature-ID direkt eingeben (aktivieren/deaktivieren)' + Write-Host ' [E] Eigene Namen anzeigen / bearbeiten' + Write-Host '' + Write-Host ' [7] Konfiguration exportieren (Backup)' + Write-Host ' [8] Konfiguration importieren' + Write-Host ' [9] Status neu einlesen' + Write-Host ' [R] Alle eigenen Aenderungen zuruecksetzen (fullreset)' + Write-Host '' + Write-Host ' [0] Beenden' + Write-Host '' + $choice = (Read-Host 'Auswahl').Trim().ToUpper() + + $byName = { param($list) $list | Sort-Object { $d = Get-DisplayName $_; if ($d) { $d } else { 'zzz' + $_ } } } + switch ($choice) { + '1' { Menu-Search } + '2' { Show-FeatureList 'Alle konfigurierten Features' { & $byName @($script:States.Keys) } } + '3' { Show-FeatureList 'Aktive Features' { & $byName @($script:States.Keys | Where-Object { $script:States[$_].State -eq 'Enabled' }) } } + '4' { Show-FeatureList 'Von dir geaenderte Features' { & $byName @($script:States.Keys | Where-Object { $script:States[$_].UserSet }) } } + '5' { Show-FeatureList 'Favoriten' { Get-Favorites } } + '6' { Menu-Direct } + 'E' { Menu-OwnNames } + '7' { Menu-Export } + '8' { Menu-Import } + '9' { Load-AllStates } + 'R' { Menu-FullReset } + '0' { exit } + } +}