Archive for category PowerCLI

How Can a User give Yes/No Prompt in Powershell

 Command to display popup:
  $a = new-object -comobject wscript.shell
$input = $a.popup("Do u want to quit") //Display ok button
$input = $a.popup("Do u want to quit",0,"TitleName",1) // Display ok,cancel button
$input = $a.popup("Do u want to quit",0,"TitleName",2) // Display abort,retry,ignore button
$input = $a.popup("Do u want to quit",0,"TitleName",3) // Display yes,no,cancel button
$input = $a.popup("Do u want to quit",0,"TitleName",4) // Display Yes,no, button
$input = $a.popup("Do u want to quit",0,"TitleName",5) // Display retry,cancel button
$input = $a.popup("Do u want to quit",0,"TitleName",6) // Display retry,cancel,continue button
Advertisements

Leave a comment

connect to the Host or VI server

The command to connect to the VCenter
$servername = “192.168.26.25”
$username = “admin”
$password = “admin”

connect-VIserver -server $servername -user $username -password $password

Definition :
This command connect to the vcenter or a single esx or esxi host

Leave a comment