Hi Jorge,
Oh good, I'm glad to hear that and that it's not me just missing
something! I tried what you suggested and wrapped the Invoke-Psake
call in my parent script (default.ps1) in an exec() call and the build
does indeed fail now. Thank you very much for the response and I look
forward to seeing what you come up with!
-Shawn
On Jul 29, 10:09 am, Jorge Matos <
matos.jo...@gmail.com> wrote:
> Shawn,
>
> That's a use case that I didn't test when I wrote the nested builds
> feature!
>
> I believe the issue is related to the fact that a new scope is implicitly
> created when the nested call is made. I was able to re-produce the issue
> with the psake example nested.ps1.
>
> I changed nested1.ps1 to the following:
>
> > Properties {
> > $x = 100
> > }
> > Task default -Depends Nested1CheckX
>
> > Task Nested1CheckX {
> > #Assert ($x -eq 100) '$x was not 100'
> > throw "oops!"
> > }
>
> and the calling script nested.ps1 did not fail - but if you change the main
> script to use exec() it does fail.
>
> Here's the nested.ps1 script:
>
>
>
>
>
> > Properties {
> > $x = 1
> > }
>
> > Task default -Depends RunNested1, RunNested2, CheckX
>
> > Task RunNested1 {
> > *exec *{ Invoke-psake .\nested\nested1.ps1 }
> > > >
psake-users...@googlegroups.com<psake-users%2Bunsubscribe@googlegr
oups.com>
> > <
psake-users%2Bunsu...@googlegroups.com<psake-users%252Bunsubscribe@goo
glegroups.com>
> >
psake-users...@googlegroups.com<psake-users%2Bunsubscribe@googlegr
oups.com>
> Jorge Matos
> Senior .NET Architect,
MCSD.NET <
http://mcsd.net/>, MCSD Visual Studio 6.0
>
(440) 666-3107
>
matos_jo...@hotmail.com
> Blog:
http://matosjorge.spaces.live.com
> --------------------------------------------------------------------------- -----