Error: The input object cannot be bound to any parameters ...

Jul 3, 2011 at 6:41 PM

Hello,

I am trying to install two packages in one command line for a project but I am getting an error:

PM> @('EntityFramework', 'Agatha-rrsl') | Install-Package
Install-Package : The input object cannot be bound to any parameters for the command either because the command does not take pipeline in
put or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:54
+ @('EntityFramework', 'Agatha-rrsl') | Install-Package <<<< 
    + CategoryInfo          : InvalidArgument: (EntityFramework:String) [Install-Package], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,NuGet.PowerShell.Commands.InstallPackageCommand

What am I doing wrong?

And can have a file to run multiple commands to install packages in various projects inside a solution and then call that script file?

Or maybe using using a single command?

Thank you,

Miguel

Jul 3, 2011 at 8:02 PM

Try adding $._ after install. You may also want foreach-object in the pipeline.

____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Jul 3, 2011 at 8:28 PM

Like this?

@('EntityFramework', 'Agatha-rrsl') | Install-Package $._

Keep getting an error ... I tried a few variations but always get an error.

Jul 3, 2011 at 8:36 PM

@('EntityFramework', 'Agatha-rrsl') | Foreach-object | Install-Package $._

____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Jul 3, 2011 at 9:54 PM
ferventcoder wrote:

@('EntityFramework', 'Agatha-rrsl') | Foreach-object | Install-Package $._

____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

I tried that suggestion but I got the error:

@('EntityFramework', 'Agatha-rrsl') | Foreach-object | Install-Package $._
ForEach-Object : Cannot process command because of one or more missing mandatory parameters: Process.
At line:1 char:53
+ @('EntityFramework', 'Agatha-rrsl') | Foreach-object <<<<  | Install-Package $._
    + CategoryInfo          : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
    + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.PowerShell.Commands.ForEachObjectCommand

And also tried to specify in which project the packages should be installed:

@('EntityFramework', 'Agatha-rrsl') | Foreach-object | Install-Package -ProjectName $MySol.Data $._
ForEach-Object : Cannot process command because of one or more missing mandatory parameters: Process.
At line:1 char:53
+ @('EntityFramework', 'Agatha-rrsl') | Foreach-object <<<<  | Install-Package -ProjectName $FlyOnDreams.FlyOnPages.Data $._
    + CategoryInfo          : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
    + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.PowerShell.Commands.ForEachObjectCommand

Same problem here. Any idea?

Thank you,

Miguel

Developer
Jul 3, 2011 at 10:10 PM

You can't pipe strings to the install command you can only pipe objects with an Id property (which map to the package id). You can do this to install a bunch of packages:

@('EntityFramework', 'Agatha-rrsl') | % { Install-Package $_ }

Jul 5, 2011 at 5:56 PM
Thank you David. I should have mentioned mine was slightly pseudo code since I was nowhere near a computer to test. :D