The following is the result of result.
PowerCLI C:\tmp> $vm = Get-VM -Name 2008t1
PowerCLI C:\tmp> .\Test-InvokeVMScript -VM $vm
PowerCLI C:\tmp>
I had copy the information of the script.
Past the information to a txt file, and save the file as Test-InvokeVMScript.ps1 in c:\tmp folder.
I had try to run the script by .\Test-InvokeVMScript -VM $vm.
But there is no information display in the the screen of command.