11 Replies Latest reply on Jan 5, 2018 1:05 PM by DZ1

    Visual Studio Code (VScode) problems with running PowerCLI commands from script pane.

    DZ1 Hot Shot

      Sorry, can't seem to find this anywhere else, I hope someone here can help me.

       

      I really want to start using VScode, and I set everything up to start using it for everything PowerShell/PowerCLI.  There is one issue that I can't seem to fix.  I set my default terminal to PowerShell, and I can run commands whether they are PowerShell or PowerCLI.  When I'm in the script window, if I want to run a command as simple as Get-Cluster, it gives me the message below:

       

      "You are not currently connected to any servers. Please connect first using a Connect cmdlet."

       

      I made sure that I connected to vCenter before, and as long as I run the command in the terminal only, it works, but if I go up to where I would write out a script, it's as if that pane is being treated like it's an entirely different session.  I included a screenshot.  Thanks for any help.