VMware Cloud Community
halr9000
Commander
Commander

feature request: Make Credential parameter on Get-VIServer positional

Think you could make Credential positional? I'd like to be able to do this:

120# get-viserver vcenter $cred

Get-VIServer : A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential'.

At line:1 char:4

Maybe user and pass for that matter. I'm just a big shell prompt kinda guy, so I'm typing these stuff in interactively all the time. I'm big on the typing savers.

119# which Connect-VIServer | Select-Object -ExpandProperty parametersets | select -ExpandProperty parameters | ft name,pos*,*pipe*

Name                           Position  ValueFromPipeline ValueFromPipelineB
                                                               yPropertyName
----                           --------  ----------------- ------------------
Server                                1              False              False
Port                        -2147483648              False              False
Protocol                    -2147483648              False              False
Credential                  -2147483648               True              False
User                        -2147483648               True              False
Password                    -2147483648              False              False
Session                     -2147483648              False              False

Hal Rottenberg

Co-Host, PowerScripting Podcast (http://powerscripting.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
Tags (1)
0 Kudos
1 Reply
bshell
Enthusiast
Enthusiast

Personally I would like to see this settable by a global variable so we dont have to re-auth.

Perhaps: $viToolKitCredentials

0 Kudos