$ErrorActionPreference = "Stop" $here = Split-Path -Parent $MyInvocation.MyCommand.Path Set-Location $here try { Stop-Process -Name "AZA_Kontroll_Huelle" -Force -ErrorAction Stop } catch {} Start-Sleep -Milliseconds 700 Write-Host "PyInstaller Ausgabe-Verzeichnis: $here\\dist" pyinstaller --noconfirm --clean .\AZA_Kontroll_Huelle.spec