Solved

Connect-NTNXCluster gives a 'Count cannot be less than zero'


Badge
I'm trying to automate creating snapshots in Nutanix from Ivanti Automation (PowerShell script). But I can't seem to connect to the cluster.

The (censored) command I use is as follows:
Connect-NTNXCluster -Server ntnxcluster.domain.local -Username admin@domain.local -Password $Password

The $Password has been converted to secure string ($Password = ConvertTo-SecureString *Password* -AsPlainText -Force)

I get the following error:
Connect-NTNXCluster : Count cannot be less than zero.
Parameter name: count
At line:1 char:1

When I use the same command without the Password switch:
Connect-NTNXCluster -Server ntnxcluster.domain.local -Username admin@domain.local
It will prompt me for the password and it will work.

What am I missing here?
icon

Best answer by aluciani 11 June 2018, 21:58

Hi @ChrisJ

This is known bug and we are currently re-writing the Nutanix PoSh cmdlets, will keep you posted. Thanks

View original

3 replies

Badge
Hmm, when I put the password switch before the username it seems to work:
Connect-NTNXCluster -Server ntnxcluster.domain.local -Password $Password -Username admin@domain.local

What sorcery is this? 🤔
ChrisJ wrote:

Hmm, when I put the password switch before the username it seems to work:Connect-NTNXCluster -Server ntnxcluster.domain.local -Password $Password -Username admin@domain.local

What sorcery is this? 🤔



Seems to me that as long as it is not the final parameter it works fine, e.g. add -Verbose.

I'm running the 5.5 Cmdlets (build version 2.5-release5.5-dev-11112017).
I get the error connecting backwards to a cluster running 5.1.2 but do not have the error connecting to 5.5.2.

In case that helps anybody, thanks ChrisJ!
Userlevel 7
Badge +35
Hi @ChrisJ

This is known bug and we are currently re-writing the Nutanix PoSh cmdlets, will keep you posted. Thanks

Reply