The community will be undergoing maintenance soon, requiring Read-Only mode. Click to learn more.

Microsoft Virtualization Discussions

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

dlmaldonado

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?

1 ACCEPTED SOLUTION

dlmaldonado

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.

View solution in original post

1 REPLY 1

dlmaldonado

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.

View solution in original post

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public