VMware Communities > VMTN > VMware vSphere™ > Automation Tools > vSphere™ PowerCLI > Discussions
4 Replies Last post: Sep 29, 2008 3:09 PM by halr9000
Reply

Requesting comments: The -Name parameter as a positional parameter

Sep 29, 2008 11:58 AM

Click to view c_shanklin's profile Master c_shanklin 740 posts since
Dec 3, 2007
VMware
We are considering changing the -Name parameter to be the first positional parameter for all Get-* and New-* cmdlets.

The idea is that "Get-X Y" will always return the object of type X named Y.
Examples:
1. Get-VM X will return the VM named X (this is the current behavior)
2. Get-VirtualSwitch X will return the Virtual Switch named X (this is not the current behavior).

Some cmdlet behavior will need to change if we do this.

Currently Get-VirtualSwitch X will return all Virtual Switches on host X. Does anyone take advantage of this behavior? Does this behavior make more sense than the proposed change?

We would appreciate any feedback.
Reply Re: Requesting comments: The -Name parameter as a positional parameter Sep 29, 2008 12:11 PM
Click to view halr9000's profile Master halr9000 808 posts since
Jun 7, 2007
We are considering changing the -Name parameter to be the first positional parameter for all Get-* and New-* cmdlets.
Currently Get-VirtualSwitch X will return all Virtual Switches on host X. Does anyone take advantage of this behavior? Does this behavior make more sense than the proposed change?

My comment is "I <3 VMware".

--
Author, Tech Prosaic blog (http://halr9000.com)
Webmaster, Psi (http://psi-im.org)
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast (http://powerscripting.net)
Follow me on Twitter: http://twitter.com/halr9000
Reply Re: Requesting comments: The -Name parameter as a positional parameter Sep 29, 2008 1:23 PM
in response to: halr9000
Click to view LucD's profile Champion LucD 2,384 posts since
Oct 31, 2005
I'm in favor of the proposed change.
Consistent parameters for all cmdlets!
Reply Re: Requesting comments: The -Name parameter as a positional parameter Sep 29, 2008 1:48 PM
in response to: halr9000
Click to view c_shanklin's profile Master c_shanklin 740 posts since
Dec 3, 2007
VMware
halr9000 wrote:
My comment is "I <3 VMware".

Uh, thanks, I guess? Does that mean you're in favor of the change?
Reply Re: Requesting comments: The -Name parameter as a positional parameter Sep 29, 2008 3:09 PM
in response to: c_shanklin
Click to view halr9000's profile Master halr9000 808 posts since
Jun 7, 2007
Yes, "I heart VMware" means I do like the change. :)






Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Actions