mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 04:48:53 +08:00
add script to easily target a single framework
This commit is contained in:
parent
8cfaa099c8
commit
88a148374e
23
tools/set-dotnet-version.ps1
Normal file
23
tools/set-dotnet-version.ps1
Normal file
@ -0,0 +1,23 @@
|
||||
param (
|
||||
[Parameter(Position = 0, mandatory = $true)]
|
||||
[string]$version
|
||||
)
|
||||
|
||||
$root = (Split-Path -parent $PSCommandPath)
|
||||
|
||||
$projs = Get-ChildItem "$root/../src" -Recurse | Where-Object { $_.extension -eq ".csproj" }
|
||||
$projs | ForEach-Object {
|
||||
$xml = New-Object XML
|
||||
$xml.Load($_.FullName)
|
||||
if($xml.Project.PropertyGroup[0].TargetFrameworks) {
|
||||
$xml.Project.PropertyGroup[0].TargetFrameworks = $version
|
||||
} else {
|
||||
if ($xml.Project.PropertyGroup.TargetFrameworks) {
|
||||
$xml.Project.PropertyGroup.TargetFrameworks = $version
|
||||
}
|
||||
}
|
||||
|
||||
$xml.Save($_.FullName)
|
||||
}
|
||||
|
||||
Write-Host "Updated dotnet version to $version for all projects."
|
Loading…
Reference in New Issue
Block a user