halr9000
Commander
Commander

why doesn't this work? Get-Inventory -Server

48# get-inventory -Server (Get-VMHost tooshort*)

Get-Inventory : Cannot bind parameter 'Server'. Cannot convert "VMware.VimAutomation.Client20.VMHostI

mpl" to "VMware.VimAutomation.Types.VIServer".

At line:1 char:22

+ get-inventory -Server <<<< (Get-VMHost tooshort*)

Yes, all of my vmhosts are named after rappers from the 80's and 90's. Smiley Happy

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
4 Replies
admin
Immortal
Immortal

The reason is because host and server are not interchangable. In this context server could refer to an individual ESX host or a VC server managing many ESX hosts. You could rewrite this as get-inventory -location (get-vmhost tooshort*).

(Note: I edited the above for accuracy)

For -server you could do this:

$server = get-viserver 1.2.3.4

get-inventory -server $server

Of course, the error message could use some work.

(P.S. we all know your host is really called vanillaice and you change it just so we wouldn't laugh at you)

0 Kudos
halr9000
Commander
Commander

I guess I just need to better understand what a container is. I would not have thought of a server as a container.

Just for the record, you will note there is no mention of Vanilla Ice. Smiley Happy

74# get-vmhost | ft name

Name

-


freshprince.qatest.iss.net

tooshort.qatest.iss.net

rundmc.qatest.iss.net

bonecrusher.qatest.iss.net # this belongs to another team

tupac.qatest.iss.net

devastator.qatest.iss.net # and this one

eazye.qatest.iss.net

icecube.qatest.iss.net

koolmoedee.qatest.iss.net

jazzyjeff.qatest.iss.net

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
halr9000
Commander
Commander

Hmm, my copy of get-inventory doesn't have a container parameter.

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
admin
Immortal
Immortal

Sorry, my mistake, -location.

In the help it says -location &lt;VIContainer[]&gt; and I got a little mixed up..

0 Kudos