You do have a connection to a vSphere Server open I assume ?
Check $global:defaultviserver
Anything displayed on screen when you leave out the redirection to the file ?
Any error message ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference