Created
November 12, 2019 20:47
-
-
Save wilson0x4d/6a72d855ef1caa70605d46ca967895db to your computer and use it in GitHub Desktop.
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
# | |
# assigns $env:BUILD_VERSION as the `AssemblyVersion` and | |
# `AssemblyFileVersion` values for all "AssemblyInfo.cs" | |
# files under current directory. | |
# | |
Get-ChildItem -R AssemblyInfo.cs | %{ $_.FullName } | %{ | |
cp $_ $('$_.tmp'); | |
(Get-Content -Raw $('$_.tmp')) -replace '(AssemblyFileVersion|AssemblyVersion)\(\"[^\"]*',$('$1("' + $env:BUILD_VERSION) > $_; | |
} | |
Get-ChildItem -R AssemblyInfo.cs | %{ sls -Pattern 'Version' $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment