$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"

# Debug
#$DebugPreference = "SilentlyContinue"
$DebugPreference = "Continue"
#$DebugPreference = "Stop"

Start-Transcript -path ("C:\log.txt") -append

#### Code Hier einfügen ####

Stop-Transcript