Invoke-MsBuild
Invoke-MsBuild copied to clipboard
Add explicit parameters to Invoke-MSBuild
I'd like to see a Target parameter for Invoke-MSBuild added as [string[]] so we don't need to pass it as a string in MsBuildParameters.
I'd also like a Properties parameter of type [hashtable] so we could write things like this:
Invoke-MSBuild -Target Clean,Build -Properties @{Configuration='Debug';OutDir='..\artifacts\'}
Bonus points if you use dynamic parameters to populate the ValidateSet attribute for the Target parameter from the MSBuild file. See https://blogs.technet.microsoft.com/heyscriptingguy/2014/03/21/use-dynamic-parameters-to-populate-list-of-printer-names/# for more information.
Edit: Thinking about this some more it might actually be very hard to do right, as Targets can be imported from other files, and if you walk the whole hierarchy you might end up with hundreds of targets, most of which would be irrelevant to the user.
Migrated from this codeplex issue
I don't know when I'll have time to get around to this one, but I'm open to accepting pull requests.