Last active
August 29, 2015 13:57
-
-
Save nvnivs/9782601 to your computer and use it in GitHub Desktop.
Recursivelly updates the version of AssemblyInfo.cs files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Recursively updates the version of AssemblyInfo.cs files | |
.Parameter baseDir | |
The root directory from which to recursively search for AssemblyInfo files | |
Defaults to the directory of the script. | |
.Link | |
https://gist.github.com/z0c | |
#> | |
param( | |
[string] $baseDir = (Resolve-Path .), | |
[Parameter(Mandatory = $true)] [string] $version | |
) | |
(Get-ChildItem -Path $baseDir -Filter AssemblyInfo.cs -Recurse) | | |
Foreach-Object { | |
(Get-Content $_.FullName) | | |
Foreach-Object { | |
$_ -replace 'AssemblyVersion.+$',"AssemblyVersion(`"$version`")]" ` | |
-replace 'AssemblyFileVersion.+$',"AssemblyFileVersion(`"$version`")]" | |
} | | |
Out-File $_.FullName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment