Search code examples
msbuildmsbuild-taskmsbuildcommunitytasks

MSBuild MSBuildCommunityTasks Task Time


I have a MSBuild project and I want the current date to be added to a zip file that I am creating.

I am using the MSBuildCommunityTasks.

<!-- Import the CommunityTasks Helpper -->
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

On the website http://msbuildtasks.tigris.org/ I can see a task called time. I have not been able to find doc on how to use Time.


Solution

  • In msbuild 4 you can now

    $([Namespace.Type]::Method(..parameters…))
    $([Namespace.Type]::Property)
    $([Namespace.Type]::set_Property(value))
    

    so I am using

    $([System.DateTime]::Now.ToString(`yyyy.MMdd`))
    

    those ticks around the format are backticks not '