Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to list all tasks in a psake build file?

I've got a default.ps1 file with several tasks, some of which I don't use all too often.

Instead of opening the file and grep'ing for the Tasks, is there a way to list them in the command line? Ideally with some description attached to them (that would be set near the tasks).

I'm thinking of something similar to what rake does with -t (see here for example)

like image 241
Bruno Lopes Avatar asked Mar 14 '11 14:03

Bruno Lopes


2 Answers

Run:

invoke-psake -docs

This will list all the defined tasks.

Output columns are:

  • Name
  • Alias
  • Depends On
  • Default (true/false)
  • Description
like image 190
beefarino Avatar answered Oct 12 '22 00:10

beefarino


I tried to visualize the task dependencies.

Not exactly what you wanted, but could help you. Look at psake-contrib/debugging.psm1 (it needs DLLs from https://github.com/stej/psake-contrib/tree/master/lib). Basically you call psake the same way as usually but instead of calling psake tasks, the tasks tree is displayed.

It doesn't display all the tasks, only the tasks that you specified on command line. Could be added though :)

like image 45
stej Avatar answered Oct 11 '22 23:10

stej