Subscribe
Accepted Solution

NetApp.Ontapi.Filer.Lun.InitiatorInfo[] instead of initiators displayed

Having trouble calling value of initiators in a script. I seem to only be able to produce "NetApp.Ontapi.Filer.Lun.InitiatorInfo[]" as the value.

If I enter the same commands into the shell, I received the correct results.

For example:

In the shell --

> $myigroup = get-naigroup VMWare
> $myigroup.Initiators

InitiatorName
-------------
21:01:00:b0:83:83:de:c5
21:01:00:b0:83:83:fg:c9

But if I use the same in a script and execute, the value of $myigroup.Initiators becomes "NetApp.Ontapi.Filer.Lun.InitiatorInfo[]".

Any ideas why?

Re: NetApp.Ontapi.Filer.Lun.InitiatorInfo[] instead of initiators displayed

Figured it out. The value of $myigroup.Initiators is an array. I needed to change it to a string in order to use it as "one value".


To do that I used the string join method:


>([string]::join(",",($myigroup.Initiators)))

Which resulted in:


21:01:00:b0:83:83:de:c5,21:01:00:b0:83:83:fg:c9


Which I could then use as a value in my Export-CSV file.