Skip to content

Can I run a nested build?

dlidstrom edited this page Feb 16, 2011 · 4 revisions

Yes, the Invoke-psake function can be called recursively from within a “task” function

The following is an example build script that has tasks that call the invoke-psake function to run other build scripts.

Properties {
	$x = 1
}

Task default -Depends RunNested1, RunNested2, CheckX

Task RunNested1 {
	Invoke-psake .\nested\nested1.ps1
}

Task RunNested2 {
	Invoke-psake .\nested\nested2.ps1
}

Task CheckX{
	Assert ($x -eq 1) '$x was not 1' 
}

Next – How can I log any errors from my build to a file?

Clone this wiki locally