Microsoft Virtualization Discussions
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.
In the shell --
> $myigroup = get-naigroup VMWare> $myigroup.Initiators
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?
See The Solution
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:
Which resulted in:
Which I could then use as a value in my Export-CSV file.
View solution in original post
Join our Discord Community