$thisplan = New-Object PSObject
Add-Member -InputObject $thisplan -MemberType NoteProperty -Name PlanID -Value $planid
Add-Member -InputObject $thisplan -MemberType NoteProperty -Name PlanName -Value $plan.name
Add-Member -InputObject $thisplan -MemberType NoteProperty -Name SessionPassword -Value $sessionpass
$schedule = $plan.backupConfiguration.advanceSchedule.periodSchedule
#DAY
add-Member -InputObject $thisplan -MemberType NoteProperty -Name DayRetention -Value $schedule.daySchedule.retentionCount
if ($schedule.daySchedule.retentionCount -gt 0)
{
$dstart = udptime($schedule.daySchedule.dayTime)
}
else
{
$dstart = ""
}
Add-Member -InputObject $thisplan -MemberType NoteProperty -Name DayStart -Value $dstart
########################
有没有办法从#day部分创建一个函数? 这只是我脚本的一小部分。