Nutanix PowerShell Cmdlets

Userlevel 4
Badge +21
I found this little gem regarding the NOS4 annonced PowerShell Cmdlets:

My question is regarding the "Get-host" cmdlet, how would this work, given that there already is a default "get-host" cmdlet in PowerShell?
(That the reason even VMware had to use "Get-VMhost" instead).

Also, the "Get-Cluster" and "Get-VM" are already used by PowerCLI, how would that play out?


This topic has been closed for comments

11 replies

Userlevel 2
Badge +12
Great question!

I've raised this with the engineering team and we will be prefixing or appending them to keep all of the Nutanix CMDlets separate and ensuring theres no overlap.

It gets really interesting when both PowerCLI and SCVMM use Get-VM 🙂
Userlevel 4
Badge +21
Great news!

Upon re-reading this list, I also noticed that many command are available as singluar or plural, like "Get-Cluster/Get-Clusters", or only as plural like "Get-Containers".

I think, for consistency, it would be better to have all command name as singluar, then return Array of objects, even if there is only one object matching. Also, as input, always accept an array, even if the array is composed of a single object.

This is very common in PowerShell and PowerCLI, and it makes life so much simpler when scripting.

Userlevel 2
Badge +12
Yea that's another one of the comments I had to the team :)

We definitely have some evolving to do here, but I'll keep pushing the team, as I'm a huge Powershell fan and these will get used a ton
Userlevel 1
Badge +9
Yes, we are aware of this and took the conscious decision to override the powershell cmdlet since users can still get the default get-host output by typing $Host in their powershell session. Users have two options here: 1. We have provided a convenience to the users whereby they can import all our cmdlet modules using any prefix they want. This will change the noun part of all our cmdlets to have the prefix they specified. The way to do that would be run our ImportModules.ps1 script (shipped with the installer) with -nounPrefix = $> ImportModules.ps1 -nounPrefix=NTNX Now get-host becomes get-NTNXHost, get-cluster becomes get-NTNXCluster etc. 2. Alternately, they can run the original cmdlet name qualifying them with the module name i.e. /Get-Cluster or /Get-Cluster This will be documented in our docs. Please let us know if you believe strongly in us changing it to make it unique and we can consider. ThanksAnjan
Userlevel 4
Badge +21
I think giving this option is great, but I think that, by default, it should be a unique name.

Having multiple, different, cmdlets with the same name is confusing for a regular PowerShell user.
Also, when contributing code in snippets or repository, one would "assume" things, that may or may not be true across users environements.

Last, for the "get-host" exemple, what if I already have scripts that make use of the default (Microsoft supplied) behavior? Just because I'm running Nutanix cmdlets along side the default PowerShell supplied one doesn't mean I should have to check all my (an others) scripts to use a specific command.

Get-VM confict between SCVMM & vSphere PowerCLI is already confusing enough, but hopefuly there is not "that" many customers running the 2 along side each others. But, except maybe for KVM, Nutanix plus either vSphere PowerCLI or SCVMM will be pretty common, so the conflit will occur.

I do think Get-NXCluster or Get-NTNXCluster (either is fine with me) by default will be a lot less confusing.

That way, and with your already existing option, power user that know what they are doing will have the opportunity to prefix all the noun, but other that will just "load and play" the module will not be confuse. The learning curve will be smoother and the snippets/code exchange simpler.

Userlevel 2
Badge +12
Just added a section to the Nutanix Bible on the Nutanix PowerShell CMDlets, much more to come here!
Badge +3

Has anyone had an success running this with Visio 2016?

Consistently getting:
"New-Object : Cannot find type [Visio.Applicaton}: make sure the assembly containing this type is loaded."

This then crashes the rest of the script.

Userlevel 7
Badge +35
Have you seen this cool script -

As well, looks like there are some updates to the viso stencil -
Userlevel 1
Badge +8
Any Plan to replace the Powershell Snapin with Modules?
Badge +3
Snapins were deprecated years ago.

Breaking a primary tenet of PowerShell discoverability, many non-standard verbs are used.

Since PowerShell is supported, please do it correctly.

Non-standard verb list:
did anyone got this [Warning]: Cluster version[5.5.2] and Cmdlets version[5.1.1] do not match. This might cause some cmdlets to not function correctly. Do you still want to continue [Y/N]? and it disconnects. Does I downloaded cmdlets from 5.5.2 cluster.. need help