So after a bit more research I came across this approach, however it still doesn't get me what I want:
function Get-CgiNcLunMapInfo ()
{
$lunmapinfo = Get-NcLunMap
$igroupinfo = Get-NcIgroup
# Create custom object for $lunmapinfo
# Empty array
$lunmapinfoobjs = @()
# Loop to set up a single custom object
foreach ($lun in $lunmapinfo) {
$props = @{ Vserver = $lun.Vserver
Path = $lun.Path
LunId = $lun.LunId
Igroup = $lun.InitiatorGroup
}
$lunmapinfoobj = New-Object -TypeName PSObject -Property $props
# Append to array
$lunmapinfoobjs += $lunmapinfoobj
}
# Create custom object for $igroupinfo
# Empty array
$igroupinfoobjs = @()
# Loop to set up a single custom object
foreach ($igroup in $igroupinfo) {
$props = @{ Igroup = $igroup.Name
Alua = $igroup.InitiatorGroupAluaEnabled
OsType = $igroup.InitiatorGroupOsType
GroupType = $igroup.InitiatorGroupType
Initiators = $igroup.Initiators
}
$igroupinfoobj = New-Object -TypeName PSObject -Property $props
# Append to array
$igroupinfoobjs += $igroupinfoobj
}
$props = @{ LunInfo = $lunmapinfoobjs
IgroupInfo = $igroupinfoobjs
}
$obj = New-Object -TypeName PSObject -Property $props
Write-Output $obj
}
The above script pushes the Get-NcLunMap objects/properties under the heading 'LunInfo' and the Get-NcIgroup objects/properties under the heading 'IgroupInfo', whereas I want to combine the properties into a single table, e.g.
Path,LunId,Igroup,Vserver,Alua,Igroup,OsType,GroupType,Initiators
Thanks