add: cleanup-windows Self-Elevation + .bat-Wrapper
cleanup-windows.ps1:
- Defensive Set-ExecutionPolicy Bypass am Anfang
- Self-Elevation: wenn nicht als Admin gestartet, relauncht das Script
sich selbst als Admin mit -ExecutionPolicy Bypass + Original-Args.
User muss nur einmal UAC bestaetigen, kein extra Befehl mehr noetig.
cleanup-windows.bat:
- Wrapper der powershell.exe mit -ExecutionPolicy Bypass aufruft.
- Funktioniert auch wenn Windows die .ps1 direkt blockt (z.B. unsignierte
Scripts global gesperrt).
- Aufruf: cleanup-windows.bat stefan [-SkipPrune] [-PruneOnly]
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
REM ════════════════════════════════════════════════════════════════
|
||||
REM ARIA — Cleanup-Wrapper fuer Windows
|
||||
REM ════════════════════════════════════════════════════════════════
|
||||
REM Ruft cleanup-windows.ps1 mit ExecutionPolicy Bypass auf.
|
||||
REM Funktioniert auch wenn Windows .ps1 direkt nicht startet.
|
||||
REM
|
||||
REM Nutzung:
|
||||
REM cleanup-windows.bat stefan
|
||||
REM cleanup-windows.bat stefan -SkipPrune
|
||||
REM
|
||||
REM Doppelklick funktioniert NICHT (braucht Username als Param).
|
||||
REM Per Konsole aufrufen.
|
||||
REM ════════════════════════════════════════════════════════════════
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0cleanup-windows.ps1" %*
|
||||
Reference in New Issue
Block a user