-
Notifications
You must be signed in to change notification settings - Fork 161
/
Update-CSProj.ps1
26 lines (26 loc) · 1.04 KB
/
Update-CSProj.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[CmdletBinding(SupportsShouldProcess)]
param([string]$chapterNumber)
$chapterNumber | Foreach-Object{
$eachChapterNumber = $_
$projects = (Get-ChildItem .\ "Chapter$eachChapterNumber*.csproj" -Recurse | Select-Object -ExpandProperty FullName | Sort-Object -Descending)
$projects | Write-Host -ForegroundColor Magenta
$projects | Foreach-Object{
git checkout $_
# return
Get-ChildItem (split-path $_ -Parent) obj | remove-item -Recurse -Force -ErrorAction SilentlyContinue
dotnet clean $_ ;
}
$projects | Where-Object{ $_ -like '*Tests.*' } | %{
#return
dotnet test $_
}
$projects | Foreach-Object{
Update-CSProjectFileToCSharp8 -csprojFilePath $_
nukeeper update --useprerelease Always --change Major --maxpackageupdates 100 -v D (split-path $_ -Parent)
Get-ChildItem (split-path $_ -Parent) obj | remove-item -Recurse -Force -ErrorAction SilentlyContinue
dotnet clean $_ ;
}
$projects | ?{ $_ -like '*Tests.*' } | Foreach-Object{
dotnet test $_
}
}