2

Is it possible to dynamically create psake tasks based on configuration (much as rake does)? For example, given a hashtable of environments:

environments {
 $dev = 'server1',
 $uat= 'server2'
}

I'd like tasks deploy.db.dev, deploy.db.uat, deploy.app.dev, deploy.app.uat etc. where the appropriate server name is provided to the task template?

Thanks

Joe
  • 333
  • 3
  • 10
  • Why don't you create a task the has the `$environment` passed as a parameter? I create many tasks such as `db-create`, `db-migrate` and they can accept a `$environment` property that is specified at the command line. Then, if necessary, you can switch on the `$environment` to do specific things. – TheCloudlessSky Nov 20 '12 at 01:58

0 Answers0