halr9000
Commander
Commander

REQ: get-vmhost server name

I'm pasting this from an email which I sent to vmware a bit ago to which they had not yet responded. Smiley Happy

I think it would make sense that if the server name provided to get-vmhost does not contain any periods, you should try a partial match and assume that is the hostname portion of a FQDN. Saves typing a * all the time.

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
2 Replies
admin
Immortal
Immortal

One thing I would worry about would be a case where your inventory has something like:

esxhost
esxhost5.example.com

now if you type get-vmhost esxhost, what happens? Either way you answer the question it might not be what you were hoping it would be, based on what you're trying to do.

0 Kudos
halr9000
Commander
Commander

Would it make sense to automatically do a -Confirm whenever there are multiple matches?

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