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>
17 lines
1.0 KiB
Batchfile
17 lines
1.0 KiB
Batchfile
@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" %*
|