Uploaded sketch not working after power off

PaulS, thanks for the guidance.

PaulS:
I think it is more likely that the setup() function is called, but that it is not initializing the wifi shield correctly. Add an LED, with appropriate resistor, and some code to setup() and flash the LED in setup(), to see when that happens.

In that case of wifi shield not initializing correctly, why would it work when I uploaded for the first time? It only happen on power cycle.