Method invocation failed because [System.Management.Automation.ScriptBlock] doesn't contain a method named 'op_Addition'.

2,169 views
Skip to first unread message

Jason Jarrett

unread,
Jan 16, 2010, 11:18:12 PM1/16/10
to psake...@googlegroups.com
After downloading the "featured" download from google code, I followed the steps to "import-module psake" (on this blog http://www.jameskovacs.com/blog/ReleasingPsakeV100PsakeV200.aspxand when I execute that command it appears to work.

I then copied the default.ps1 (from the examples) into my project root directory (where I was going to start creating the build).

I then type "psake" at the command hoping for it to work and the following error was printed to the screen.

Any thoughts?

Method invocation failed because [System.Management.Automation.ScriptBlock] doesn't contain a method named 'op_Addition
'.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:528 char:23
+     $script:properties += <<<<  $properties
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

You cannot call a method on a null-valued expression.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:469 char:36
+     Assert (!$script:tasks.ContainsKey <<<< ($taskKey)) "Error: Task, $name, has already been defined."
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Property 'default' cannot be found on this object; make sure it exists and is settable.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:471 char:16
+     $script:tasks. <<<< $taskKey = $newTask
    + CategoryInfo          : InvalidOperation: (default:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:469 char:36
+     Assert (!$script:tasks.ContainsKey <<<< ($taskKey)) "Error: Task, $name, has already been defined."
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Property 'test' cannot be found on this object; make sure it exists and is settable.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:471 char:16
+     $script:tasks. <<<< $taskKey = $newTask
    + CategoryInfo          : InvalidOperation: (test:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:469 char:36
+     Assert (!$script:tasks.ContainsKey <<<< ($taskKey)) "Error: Task, $name, has already been defined."
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Property 'compile' cannot be found on this object; make sure it exists and is settable.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:471 char:16
+     $script:tasks. <<<< $taskKey = $newTask
    + CategoryInfo          : InvalidOperation: (compile:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:469 char:36
+     Assert (!$script:tasks.ContainsKey <<<< ($taskKey)) "Error: Task, $name, has already been defined."
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Property 'clean' cannot be found on this object; make sure it exists and is settable.
At C:\Users\jasonj\Documents\WindowsPowerShell\Modules\psake\psake.psm1:471 char:16
+     $script:tasks. <<<< $taskKey = $newTask
    + CategoryInfo          : InvalidOperation: (clean:String) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

James Kovacs

unread,
Jan 17, 2010, 9:52:27 PM1/17/10
to psake...@googlegroups.com
The command is invoke-psake to match PowerShell's verb-noun syntax. (This was changed when psake was re-written as a PowerShell v2 module.) You can alias it if you would prefer a shorter syntax. I just tried it locally with the latest bits and was successful. Let us know if invoke-psake doesn't work on your box.

James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP
http://www.jameskovacs.com
jko...@post.harvard.edu
403-397-3177 (mobile)


--
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.


Jason Jarrett

unread,
Jan 18, 2010, 1:29:15 PM1/18/10
to psake...@googlegroups.com
That worked, thanks for the clarification...
Reply all
Reply to author
Forward
0 new messages