Have multiple parameters for a Task? (Possible?)

175 views
Skip to first unread message

Daniel

unread,
May 22, 2012, 10:15:05 PM5/22/12
to psake-users
Hello,

I would like to have multiple parameters for a couple of tasks but the
second parameter is not being accepted.

My script:

properties {
$directory = 'C:\Demo\'
$website = $directory + 'InetPub\'
$backup = $directory + 'backup\'

$deployWebsite = $false
$deployService = $false
}

task default -depends BackupWebsite, InstallWebsite, BackupService,
InstallService

task BackupWebsite -precondition { return $deployWebsite } -depends
InstallWebsite {
"backing up website..."
}

task InstallWebsite {
"installing website..."
}

task BackupService -precondition { return $deployService } -depends
InstallService {
"backing up service..."
}

task InstallService {
"installing service..."
}

I am learning psake (and powershell) so it is entirely possible I am
not understanding what some of these parameters are for.

My goal is to use the parameters to determine if the website or
service should be deployed (that works) but I do not want to run the
'Install' tasks if the 'Backup' tasks fail.

Any suggestions?
Reply all
Reply to author
Forward
0 new messages