Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Error when alling pSake from the command line or the ISE
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Romain  
View profile  
 More options May 24 2010, 1:03 am
From: Romain <choicesm...@gmail.com>
Date: Sun, 23 May 2010 22:03:34 -0700 (PDT)
Local: Mon, May 24 2010 1:03 am
Subject: Error when alling pSake from the command line or the ISE
Hi everyone,

I've been using pSake for a few weeks now and everything was working
great!
We currently call the builds sucessfully on both desktops and the CI
server like this:

>  powershell.exe .\build.ps1   (this script imports the module and invokes pSake on the tasks file)

However, for various reasons (I can elaborate if needed), I realised I
needed to invoke pSake like this:

>  powershell.exe -File build.ps1

However this approach failed, giving the following error message:

The variable '$script:context' cannot be retrieved because it has not
been set.
At C:\Documents and Settings\Administrator\Desktop\Powershell\pSake
\pSake.psm1:24 char:42
+ [system.collections.stack]$script:context <<<<
    + CategoryInfo          : InvalidOperation: (script:context:Token)
[], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : VariableIsUndefined

I could not find any information on this online, and I have reproduced
it on a few machines.
Note that I get the same error message when running build.ps1 from the
ISE, which would be nice for debugging purposes.

Would anyone have any ideas on what could be the cause of this, and
how to fix it?

Thanks,

Romain

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Romain  
View profile  
 More options May 24 2010, 9:48 pm
From: Romain <choicesm...@gmail.com>
Date: Mon, 24 May 2010 18:48:17 -0700 (PDT)
Local: Mon, May 24 2010 9:48 pm
Subject: Re: Error when alling pSake from the command line or the ISE
Hi again,

I finally found what was causing the error!
Since Powershell 2.0 came out I usually always start my scripts with:

Set-StrictMode -Version 2

This catches any unset variables, non-existent properties....
It seems that it does not play well with pSake.

Why it took me so long to realize, is that I just found out there is a
difference between

powershell.exe .\build.ps1           >  ignores the strict mode cmdlet
and runs fine
powershell.exex -File build.ps1    >  applies the strict mode cmdlet
and fails to load pSake

For the moment I will simply remove strict mode from my scripts.
Is this something that pSake might handle in the future?

Thanks,

Romain

On May 24, 3:03 pm, Romain <choicesm...@gmail.com> wrote:

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »