As far as I can tell your script is working correctly, but you don't do anything with the result of the Get-VM you execute.
Have a look at the attached update of your script, I added a ListBox to display the names of the VMs.
You can find a more elaborate example in Event-O-Matic, a Gui application we showed at VMworld.