How can I make a pop-up for username\password appear when executing the get-viserver cmdlet?
This is what I found on M$ site it makes use of the vbscript inputbox function:
$a = new-object -comobject MSScriptControl.ScriptControl $a.language = "vbscript" $a.addcode("function getInput() getInput = inputbox(`"Message box prompt`",`"UserName`") end function" ) $b = $a.eval("getInput")
You could use the cmdlet Get-Credential which comes with it's own form.
And use the returned credentials as input to Get-ViServer.
Get-ViServer -Credentials (Get-Credentials)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Very cool, Thanks! There is no "s" though in get-credential
Sorry about the typo
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference