- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - VMware
- >
- Problems using Get-ESXCLI with HPSSACLI
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2014 01:09 AM - edited 03-14-2014 01:12 AM
03-14-2014 01:09 AM - edited 03-14-2014 01:12 AM
Problems using Get-ESXCLI with HPSSACLI
Running ESXi 5.1 (free version) on a HP DL580 G7
I'm trying to use Get-ESXICli to run HPSSACLI commands from Powershell. When trying to run the following commands I get an InvalidCastException :-
$esxcli=get-esxcli
$esxcli.hpssacli.cmd("help")
Unable to cast object of type 'System.String' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'.
At line:1 char:1
+ $esxcli.hpssacli.cmd('"-q "controller all show status""')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], InvalidCastException
+ FullyQualifiedErrorId : System.InvalidCastException
Now if look at the method definition for cmd (by running $esxcli.hpssacli) it shows this
Methods:
--------
string[] cmd(string cmdopts)
That means that it expects to receive a string as a parameter to CMD and then returns a string array called (stupidly) "string[]". So, the command I'm running is perfectly fine but what is, in fact, being returned is a single string value. So, Powershell throws an error saying, quite rightly, that it cannot convert a single string to a string array.
This seems like a bug to me. It's expecting a string array but returning a single string.
Compare that with the the native ESXICLI List method of the CPU object ($esxcli.hardware.cpu)
Methods:
--------
Cpu[] list()
That returns a string array called CPU[] when the List method is run and, naturally, this works just fine.
So, am I formatting the HPSSACLI incorrectly or is this a bug? I suspect the latter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2014 08:21 AM
03-14-2014 08:21 AM
Re: Problems using Get-ESXCLI with HPSSACLI
It's not a bug in the HPSSACLI , it's in the PowerCLI module. The latest release (r2) fixes it