Solved

Using Visual Studio Code with Nutanix Cmdlets

  • 2 August 2019
  • 2 replies
  • 1015 views

I am a huge VS Code user, all I do is run my scripts/codes for local/remote/cloud products within VS Code.

So I am now trying to get it so I can compile and run Nutanix Cmdlets within VS Code. I am trying to find the neatest, safest and most maintainable way possible without putting at risk the core of PowerShell.

I've only found one post where someone has mentioned doing this and it was by installing the Nutanix Cmdlets and copying the contents of the module's folder into "C:\Windows\System32\WindowsPowerShell\v1.0\Modules". Maybe possible but there are over 200 items that would need copying into the root of this folder, seems messy to me.

Can a sub folder called Nutanix be created for the contents to be copied too? Is there a better way to achieving what I feel be a great tool for all?

Advice/support much appreciated 🤓
icon

Best answer by andymlloyd 14 August 2019, 13:32

View original

This topic has been closed for comments

2 replies

Userlevel 2
Badge +2
Hi James,

Just do the following:

  1. Open VSCode (as Admin)
  2. Then Run . "C:\Program Files (x86)\Nutanix Inc\NutanixCmdlets\powershell\import_modules\ImportModules.PS1"
  3. Then Add-PSSnapin nutanixcmdletspssnapin
Then all the cmdlets are available

This assumes you have already downloaded and installed the Nutanix Cmdlets from Prism.

Enjoy!
Userlevel 7
Badge +34
Hi @JamesCook

Did you see the reply from @andymlloyd

If it helps, please consider clicking the 'like' and 'best answer' link as that will help others in the community find the answer much quicker - Thanks