Use the commands in the following order
create-branches.ps1
upgrade-packages.ps1
push-branches.ps1
## | |
## Be careful, because it's doing a git clean and git reset for all given repos! | |
## How to use: .\create-branches.ps1 -repos .\project-1,.\project-2 -branch feature/nuget-updates | |
## | |
param ([string[]] $repos, [string] $branch) | |
foreach ($repo in $repos) { | |
Write-Host "[Create-Branches] Creating branch for" $repo -ForegroundColor "Green" | |
Set-Location -Path $repo | |
git checkout master | |
git clean -fd | |
git reset --hard | |
git pull | |
git checkout -B $branch | |
git push -u origin $branch | |
cd.. | |
} |
## | |
## Prerequisite: dotnet tool install --global dotnet-outdated-tool | |
## How to use: .\upgrade-packages.ps1 -repos .\project-1,.\project-2 | |
## | |
param ([string[]] $repos) | |
foreach ($repo in $repos) { | |
Write-Host "[Upgrade-Packages] Start to upgrade packages for" $repo -ForegroundColor "Green" | |
Set-Location -Path $repo | |
Write-Host "[Upgrade-Packages] Upgrade packages for" $repo -ForegroundColor "Green" | |
dotnet outdated --include my.custom.packages -u | |
Write-Host "[Upgrade-Packages] Build solution for" $repo -ForegroundColor "Green" | |
dotnet build | |
cd.. | |
} |
## | |
## Be careful, because it's commiting and pushing to all given repos! | |
## How to use: .\push-branches.ps1 -repos .\project-1,.\project-2 -commit "Update packages" | |
## | |
param ([string[]] $repos, [string] $commit) | |
foreach ($repo in $repos) { | |
Write-Host "[Push-Branches] Commit changes branch for" $repo -ForegroundColor "Green" | |
Set-Location -Path $repo | |
git add . | |
git commit -m $commit | |
git push | |
cd.. | |
} |