9 Replies Latest reply on Apr 19, 2019 11:23 AM by LucD

    Microsoft Visual Studio Code (VS Code) can not access vi and vis, vmstore and vmstores. Get-PSDrive and New-PSDrive -PSProvider VimDatastore dont work as expected

    aakuzmenko Lurker

      Hi, I had been testing waters with Microsoft Visual Studio Code (VS Code).

      Running into some inconsistences.  Cannot run PowerCLI scripts that call PSDrive. It appears VScode cannot access VIM Inventory providers. I am running VS Code as Administrator

      Any suggestions on how to work with PSDrive under VS Code? Perhaps I need to adjust VS code settings\permissions to get access to VimInventory? Below is comparison of VS Code vs ISE

      Thank you

      Example: Get-PSDrive under VScode. There are no vi or vis listed

      **************************************************************************

      PS C:\> Get-PSDrive

       

      Name           Used (GB)     Free (GB) Provider      Root                                                                                                                                                                                            CurrentLocation

      ----           ---------     --------- --------      ----                                                                                                                                                                                            ---------------

      Alias                                  Alias

      C                  71.65        166.21 FileSystem    C:\

      Cert                                   Certificate   \

      D                                      FileSystem    D:\

      Env                                    Environment

      Function                               Function

      HKCU                                   Registry      HKEY_CURRENT_USER

      HKLM                                   Registry      HKEY_LOCAL_MACHINE

      Variable                               Variable

      WSMan                                  WSMan

      ********************************************************************

      Example: Get-PSDrive under ISE. There are vi and vis, vmstore and vmstores!

      *************************************************************

      PS C:\> Get-PSDrive

       

      Name           Used (GB)     Free (GB) Provider      Root                                                                                                                                                                                         CurrentLocation

      ----           ---------     --------- --------      ----                                                                                                                                                                                         ---------------

      Alias                                  Alias                                                                                                                                                                                                                     

      C                  71.66        166.21 FileSystem    C:\                                                                                                                                                                                                         

      Cert                                   Certificate   \                                                                                                                                                                                                           

      D                                      FileSystem    D:\                                                                                                                                                                                                         

      Env                                    Environment                                                                                                                                                                                                               

      Function                               Function                                                                                                                                                                                                                  

      HKCU                                   Registry      HKEY_CURRENT_USER                                                                                                                                                                                           

      HKLM                                   Registry      HKEY_LOCAL_MACHINE                                                                                                                                                                                         

      Variable                               Variable                                                                                                                                                                                                                 

      vi                                     VimInventory  \LastConnectedVCenterServer                                                                                                                                                                                

      vis                                    VimInventory  \                                                                                                                                                                                                          

      vmstore                                VimDatastore  \LastConnectedVCenterServer                                                                                                                                                                                

      vmstores                               VimDatastore  \                                                                                                                                                                                                          

      WSMan                                  WSMan