code:
$pd = Get-NTNXProtectionDomain | where {$_.Active -eq $True}
#Showing basically how the loop is setup
foreach($p in $pd){
$e = (Get-NTNXProtectionDomainCronSchedule -PDName $p.Name).userStartTimeInUsecs
#showing how my custom object is built
$dpcust = @{
ProtectionDomain = $p.Name
VMName = $p.vms.VMName -join ","
NextSnapshot = $scheduledtime
Usage = $convertUsage
Schedule = $p.cronschedules.Type
LocalRetention = $p.cronschedules.retentionpolicy.localmaxsnapshots -join ","
}
}