Connect-NTNXCluster gives a Count cannot be less than zero

  • 15 April 2021
  • 1 reply


I have the same issue as this thread : Connect-NTNXCluster gives a 'Count cannot be less than zero' I installed the latest Ntnx Cmdlets from our NTX cluster (it’s on 5.15.3)

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

How can i fix it please ?

I tried with plain text but not working, i also use with Converto-SecureString but no success…

It only works when i put password through pop-up…

I tried also to creat password with that but...

$credential = Get-Credential
$credential | Export-CliXml -Path "C:\Scripts\securecreds\Nutanixsecurecreds.cred"

$credNutanix = Import-CliXml -Path "C:\Scripts\securecreds\Nutanixsecurecreds.cred"

How can i put username and password through the script without pop-up i need to run every week the script.

This topic has been closed for comments

1 reply

try this @LDams

$readerpassword = (Read-Host "Password for $NutanixCluster" -AsSecureString)