VMware Cloud Community
IanTech
Enthusiast
Enthusiast

Script windows closes

Hi,

When I run a script from the vCLI it opens a windows. It runs the script and closes the window immediately even it it successful or failed. I would like the window to stay open so I can see if it failed and what the error is?

Thanks,

0 Kudos
3 Replies
bulletprooffool
Champion
Champion

As you posted this in PowerCLi, I suspect you mean that you are getting a PowerCli window pops up and closes?

you could either copy the contents of youir script to a windows and run it there, or simply drop something like a read-host at the end of your script, to wait for an entry.

You should really though consider getting your script to log its output somewhere.

One day I will virtualise myself . . .
0 Kudos
IanTech
Enthusiast
Enthusiast

Hi,

Thanks for the reply, yes when I run esxcfg-scsidevs.pl -server <servername> -l a perl.exe window opens the commands runs then closes immediately. How would I get the script to output to a text file so I can see what was going on.

Thanks,

0 Kudos
bulletprooffool
Champion
Champion

If you are using perl, you could create a delay at the end ofscript by adding a :

sleep(seconds);

One day I will virtualise myself . . .
0 Kudos