Skip to content

Instantly share code, notes, and snippets.

@MrJerB
MrJerB / clean-helpers.ps1
Created December 10, 2018 15:05
Powershell dev cleanup helpers
function CleanBinObj {
Get-ChildItem .\ -include bin, obj -Recurse | ForEach-Object ($_) { remove-item $_.fullname -Force -Recurse }
}
Set-Alias Clean-BinObj CleanBinObj -Option AllScope
function CleanGitMergedMaster {
git checkout master;
git branch --merged |
ForEach-Object { $_.Trim('*', ' ') } |
Where-Object { ($_ -ne 'master') -and ($_ -ne 'develop') } |
@MrJerB
MrJerB / Publish-RemoteReleaseBranch.ps1
Last active January 11, 2022 14:19
Create release branch on origin with same name as currently checked out feature branch.
function Publish-RemoteReleaseBranch {
param ([string] $Suffix = $null, [switch] $Copy = $false, [switch] $SetGlobal = $false)
$currentBranch = git branch --show-current;
if (!$currentBranch.StartsWith("feature/")) {
Write-Host "Not a feature branch";
return;
}