Setting Properties From Invoke-psake

128 views
Skip to first unread message

hwiechers

unread,
Nov 1, 2009, 4:55:48 AM11/1/09
to psake-users
How do I set the value of a property from Invoke-psake?
Looked through documentation and googled but I can't find any
information on it.

Dan Ryan

unread,
Dec 23, 2009, 7:04:46 AM12/23/09
to psake-users
Has anyone got an answer for this? I am trying to affect the psake
property $psake.use_exit_on_error before or during the call to Invoke-
psake. I have been unable to get this working.

Dan Ryan

unread,
Dec 23, 2009, 6:55:28 AM12/23/09
to psake-users
Any answers for this? I am having the same problem. I am trying to
set the psake property $psake.use_exit_on_error before calling invoke-
psake but it is not having an affect. Any help will be grateful.

On Nov 1, 9:55 am, hwiechers <hwiech...@gmail.com> wrote:

Chris Bilson

unread,
Dec 23, 2009, 9:52:01 AM12/23/09
to psake...@googlegroups.com
Not sure if this helps, but...

I wanted to do something like this to use different settings for TeamCity and command line builds. I made two psake scripts with different values for some variables, then from each, include the same psake script that defines the tasks in my build and uses those variables. I still don't get to set/override any properties from the command line before running the script, but this way I don't have to and the build just does the right thing.

--c


--

You received this message because you are subscribed to the Google Groups "psake-users" group.
To post to this group, send email to psake...@googlegroups.com.
To unsubscribe from this group, send email to psake-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psake-users?hl=en.



Jorge Matos

unread,
Dec 28, 2009, 12:19:21 AM12/28/09
to psake...@googlegroups.com
Dan,

You've found a bug in the code, I explicitly set the variable
$psake.use_exit_on_error to $false in the Invoke-psake function.

You just need to comment out line 887 in the psake.psm1 file and it should
work. I'll fix this in my next commit to psake.

By the way, the $psake variable is not a property in the sense of properties
that you set in a psake build file. The $psake variable is more of a
control/feedback mechanism that you can inspect from the coded that calls
the Invoke-psake function.

The ability to pass values to properties that are defined in a psake script
does not exist. For example, it would be nice to do something like this:

Invoke-psake .\mybuild.ps1 -properties @{ "ConnectionString"="xxxxx";
"BackupLogs"=$true }

I intend to add this feature to psake in the future.

Thanks!

--------------------------------------------------
From: "Dan Ryan" <mail.d...@googlemail.com>
Sent: Wednesday, December 23, 2009 5:55 AM
To: "psake-users" <psake...@googlegroups.com>
Subject: Re: Setting Properties From Invoke-psake

Reply all
Reply to author
Forward
0 new messages