script-modules/RemoveLocalBranches.psm1
1 2 3 4 5 6 7 |
function Remove-LocalBranches ([switch]$Force) { git branch | Where-Object { $_ -notmatch '(^\*)|(^. master$)' } | ForEach-Object { git branch $(if($Force) { '-D' } else { '-d' }) $_.Substring(2) } } Export-ModuleMember *-* |