git branch --merged | Select-String -Pattern '^(?!.*(main|master)).*$' | ForEach-Object { git branch -d $_.ToString().Trim() }