Created
June 16, 2017 14:04
-
-
Save lennybacon/369a155cf23f7c3bcb7d40f1af33e3a2 to your computer and use it in GitHub Desktop.
MsBuild property with the latest version of a file
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
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<NugetFixUpTaskPaths>$([System.IO.Directory]::GetFiles("$(UserProfile)\.nuget\packages\nugetfixuptasks", "*.targets", SearchOption.AllDirectories))</NugetFixUpTaskPaths> | |
<LatestNugetFixUpTaskImport>$(NugetFixUpTaskPaths.Remove(0, $([MSBuild]::Add( $(NugetFixUpTaskPaths.LastIndexOf(";")), 1 )) ))</LatestNugetFixUpTaskImport> | |
</PropertyGroup> | |
<Import Project="$(LatestNugetFixUpTaskImport)" /> | |
<Target Name="Build"> | |
<Message Text="LatestNugetFixUpTaskImport: $(LatestNugetFixUpTaskImport)" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References: