function p4get-maintenanceTasks {param([switch]$allInstances) $static = [xml](gc $env:depotsxml) if ($allInstances) { if ($static.perforce.maintenance) { $static.perforce.maintenance } else { write-error "No maintenance task data is defined." } } else { if ($static.perforce.maintenance | ?{$_.name -eq (p4get-replicationTopology).name}) { $static.perforce.maintenance | ?{$_.name -eq (p4get-replicationTopology).name} } else { if ($static.perforce.maintenance | ?{$_.name -eq $env:p4server}) { $static.perforce.maintenance | ?{$_.name -eq $env:p4server} } else { write-error "No maintenance task data is defined for this Perforce instance." } } } }