Solved

NTXCmdlet error


Badge +7
after installing the ntxpowershell cmdlets and trying to excute the run.bat I get the below error?

At C:Program Files (x86)Nutanix IncNutanixCmdletspowershellimport_modulesPreReqCheckAndImport.ps1:21 char:5+ [string] $args = "+ ~~~~~~~~~~~~~~Cannot assign automatic variable 'args' with type 'System.Object[]'+ CategoryInfo : ParserError: (:) [], ParseException+ FullyQualifiedErrorId : AssignmentStatementToAutomaticNotSupported
icon

Best answer by elsnook 11 May 2017, 20:00

I had the same issues and replacing $args with $args_new fixed it for me.

Windows 10
Powershell Major 5, Minor 1, Build 15063

View original

8 replies

Userlevel 7
Badge +30
What version of AOS did you get that powershell installer from?
Badge +7
Versions below.

AOS: 2017.01.10
Hyper: Nutanix 20150513
NCC: 3.0.0
foundation-3.5-7ca0fb1f
Badge
mgalloway I had the same problem. I got round it by running the following commands from a standard PowerShell session:

C:Program Files (x86)Nutanix IncNutanixCmdletspowershellimport_modulesImportModules.ps1Add-PSSnapin NutanixCmdletsPSSNapin

Userlevel 7
Badge +30
hey folks, sorry I let this one slide. Asking engineering about this now.
Userlevel 4
Badge +19
mgalloway Can you provide the below details.

Windows OS version:
Powershell Version

Can you try the below?

1) Edit File PreReqCheckAndImport.ps1 [Path -> C:Program Files (x86)Nutanix IncNutanixCmdletspowershellimport_modules]

2) Find "$args" and replace all with "$args_new"

3) Save the file

4) Re-run the run.bat file as administrator.

Regards,
Sandeep MP
Badge +2
I had the same issues and replacing $args with $args_new fixed it for me.

Windows 10
Powershell Major 5, Minor 1, Build 15063
Userlevel 7
Badge +35
Hi mgalloway

Did you see elsnook note? Did that help?

If yes, consider clicking the 'Accept ss Solution' button, this will help others with similar issues.

Thanks
Badge +4
super had me stumped, changing $args to $args_new worked for me

Reply