<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems using Get-ESXCLI with HPSSACLI in Operating System - VMware</title>
    <link>https://community.hpe.com/t5/operating-system-vmware/problems-using-get-esxcli-with-hpssacli/m-p/6413280#M1960</link>
    <description>Solved it!!&lt;BR /&gt;&lt;BR /&gt;It's not a bug in the HPSSACLI , it's in the PowerCLI module. The latest release (r2) fixes it</description>
    <pubDate>Fri, 14 Mar 2014 15:21:37 GMT</pubDate>
    <dc:creator>Ginolard1</dc:creator>
    <dc:date>2014-03-14T15:21:37Z</dc:date>
    <item>
      <title>Problems using Get-ESXCLI with HPSSACLI</title>
      <link>https://community.hpe.com/t5/operating-system-vmware/problems-using-get-esxcli-with-hpssacli/m-p/6412828#M1959</link>
      <description>&lt;P&gt;Running ESXi 5.1 (free version) on a HP DL580 G7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use Get-ESXICli to run HPSSACLI commands from Powershell.&amp;nbsp; When trying to run the following commands I get an InvalidCastException :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$esxcli=get-esxcli&lt;/P&gt;&lt;P&gt;$esxcli.hpssacli.cmd("help")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Unable to cast object of type 'System.String' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;At line:1 char:1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+ $esxcli.hpssacli.cmd('"-q "controller all show status""')&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : OperationStopped: (:) [], InvalidCastException&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : System.InvalidCastException&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if look at the method definition for cmd (by running $esxcli.hpssacli) it shows this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Methods:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;--------&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;string[] cmd(string cmdopts)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;That means that it expects to receive a string as a parameter to CMD and then returns a string array called (stupidly) "string[]".&amp;nbsp; So, the command I'm running is perfectly fine but what is, in fact, being returned is a single string value.&amp;nbsp; So, Powershell throws an error saying, quite rightly, that it cannot convert a single string to a string array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems like a bug to me.&amp;nbsp; It's expecting a string array but returning a single string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compare that with the the native ESXICLI List method of the CPU object ($esxcli.hardware.cpu)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Methods:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;--------&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Cpu[] list()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;That returns a string array called CPU[] when the List method is run and, naturally, this works just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, am I formatting the HPSSACLI incorrectly or is this a bug?&amp;nbsp; I suspect the latter&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 08:12:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-vmware/problems-using-get-esxcli-with-hpssacli/m-p/6412828#M1959</guid>
      <dc:creator>Ginolard1</dc:creator>
      <dc:date>2014-03-14T08:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using Get-ESXCLI with HPSSACLI</title>
      <link>https://community.hpe.com/t5/operating-system-vmware/problems-using-get-esxcli-with-hpssacli/m-p/6413280#M1960</link>
      <description>Solved it!!&lt;BR /&gt;&lt;BR /&gt;It's not a bug in the HPSSACLI , it's in the PowerCLI module. The latest release (r2) fixes it</description>
      <pubDate>Fri, 14 Mar 2014 15:21:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-vmware/problems-using-get-esxcli-with-hpssacli/m-p/6413280#M1960</guid>
      <dc:creator>Ginolard1</dc:creator>
      <dc:date>2014-03-14T15:21:37Z</dc:date>
    </item>
  </channel>
</rss>

