API

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

NTXCmdlet error

SOLVED Go to solution
Adventurer

NTXCmdlet error

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

 

At C:\Program Files (x86)\Nutanix Inc\NutanixCmdlets\powershell\import_modules\PreReqCheckAndImport.ps1:21 char:5
+ [string] $args = "
+ ~~~~~~~~~~~~~~
Cannot assign automatic variable 'args' with type 'System.Object[]'
+ CategoryInfo : ParserError: (Smiley Happy [], ParseException
+ FullyQualifiedErrorId : AssignmentStatementToAutomaticNotSupported

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Pathfinder

Re: NTXCmdlet error

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

 

Windows 10

Powershell Major 5, Minor 1, Build 15063

Tags (1)
8 REPLIES
Moderator Moderator
Moderator

Re: NTXCmdlet error

What version of AOS did you get that powershell installer from?

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!
Tags (1)
Adventurer

Re: NTXCmdlet error

Versions below.

 

AOS: 2017.01.10

Hyper: Nutanix 20150513 

NCC: 3.0.0

foundation-3.5-7ca0fb1f

Tags (1)
Squire

Re: NTXCmdlet error

@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 Inc\NutanixCmdlets\powershell\import_modules\ImportModules.ps1
Add-PSSnapin NutanixCmdletsPSSNapin

 

 

Tags (1)
Moderator Moderator
Moderator

Re: NTXCmdlet error

hey folks, sorry I let this one slide. Asking engineering about this now.

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!
Tags (1)
Nutanix Employee

Re: NTXCmdlet error

@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 Inc\NutanixCmdlets\powershell\import_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

Tags (1)
Pathfinder

Re: NTXCmdlet error

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

 

Windows 10

Powershell Major 5, Minor 1, Build 15063

Tags (1)
Highlighted
Community Manager

Re: NTXCmdlet error

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  

Tags (1)
Voyager

Re: NTXCmdlet error

super had me stumped, changing $args to $args_new worked for me