Invoke-MsBuild icon indicating copy to clipboard operation
Invoke-MsBuild copied to clipboard

Add explicit parameters to Invoke-MSBuild

Open redoz opened this issue 9 years ago • 3 comments

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\'}

redoz avatar May 25 '16 10:05 redoz

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.

redoz avatar May 25 '16 10:05 redoz

Migrated from this codeplex issue

deadlydog avatar May 25 '16 15:05 deadlydog

I don't know when I'll have time to get around to this one, but I'm open to accepting pull requests.

deadlydog avatar Apr 20 '17 07:04 deadlydog