dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

New-DbaAgentSchedule's documentation does not illustrate most of its parameters #9403

Open ReeceGoding opened 1 week ago

ReeceGoding commented 1 week ago

Summarize Functionality

Every time that I want to use New-DbaAgentSchedule, I need to crack open my copy of Learn dbatools in a Month of Lunches. Standard parameters aside, the function has 14 parameters:

  1. [[-Job] <Object[]>]
  2. [[-Schedule] <Object>]
  3. [-Disabled]
  4. [[-FrequencyType] <Object>]
  5. [[-FrequencyInterval] <Object[]>]
  6. [[-FrequencySubdayType] <Object>]
  7. [[-FrequencySubdayInterval] <Int32>]
  8. [[-FrequencyRelativeInterval] <Object>]
  9. [[-FrequencyRecurrenceFactor] <Int32>]
  10. [[-StartDate] <String>]
  11. [[-EndDate] <String>]
  12. [[-StartTime] <String>]
  13. [[-EndTime] <String>]
  14. [[-Owner] <String>]

Of these 14 parameters, more than half have no examples in the documentation. Specifically, the following 9 have none:

and Force is used in every example.

This should be corrected, but the fact that I have to use the documentation so much to notice this issue proves that I'm not qualified to solve it!

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

Directly stealing examples from Learn dbatools in a Month of Lunches would be a great step forward. A little more variety in the schedules would also be welcome. For example, I'm sure that plenty of people write jobs that run twice per day or every hour.