diff --git a/bin/dbatools-buildref-index.json b/bin/dbatools-buildref-index.json index 8d68193030..6b55470908 100644 --- a/bin/dbatools-buildref-index.json +++ b/bin/dbatools-buildref-index.json @@ -1,5 +1,5 @@ { - "LastUpdated": "2024-05-16T00:00:00", + "LastUpdated": "2024-06-13T00:00:00", "Data": [ { "Version": "8.0.47", @@ -4579,6 +4579,11 @@ "Version": "15.0.4365", "KBList": "5035123" }, + { + "CU": "CU27", + "Version": "15.0.4375", + "KBList": "5037331" + }, { "Version": "16.0.100", "Name": "2022" diff --git a/bin/dbatools-index.json b/bin/dbatools-index.json index ab6987c2f2..36396eb330 100644 Binary files a/bin/dbatools-index.json and b/bin/dbatools-index.json differ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2012.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2012.sql index dc8d0ce1b7..c13dc7dc97 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2012.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2012.sql @@ -1,7 +1,7 @@ -- SQL Server 2012 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -365,10 +365,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -380,6 +380,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2014.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2014.sql index 72c237e65f..55706f6d25 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2014.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2014.sql @@ -1,7 +1,7 @@ -- SQL Server 2014 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -359,10 +359,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -374,6 +374,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2016.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2016.sql index fb8e02dc53..ea1e8f7fde 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2016.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2016.sql @@ -1,7 +1,7 @@ -- SQL Server 2016 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -341,10 +341,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -356,6 +356,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2016SP2.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2016SP2.sql index 7232846b1e..df9a137508 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2016SP2.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2016SP2.sql @@ -1,7 +1,7 @@ -- SQL Server 2016 SP2 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -323,10 +323,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -338,6 +338,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2017.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2017.sql index 23d11e79de..fae3ef26d9 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2017.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2017.sql @@ -1,7 +1,7 @@ -- SQL Server 2017 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -344,10 +344,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -359,6 +359,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2019.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2019.sql index c0f55ce5f2..f718ff9636 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2019.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2019.sql @@ -1,7 +1,7 @@ -- SQL Server 2019 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -100,7 +100,8 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 15.0.4345.5 CU24 12/14/2023 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate24 -- 15.0.4355.3 CU25 2/15/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate25 -- 15.0.4360.2 CU25 + GDR 4/9/2024 https://support.microsoft.com/en-us/topic/kb5036335-description-of-the-security-update-for-sql-server-2019-cu25-april-9-2024-eb3571d0-62ee-445e-9681-5715caf9bbc2 --- 15.0.4365.2 CU26 4/11/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate26 +-- 15.0.4365.2 CU26 4/11/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate26 +-- 15.0.4375.4 CU27 6/13/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate27 -- How to determine the version, edition and update level of SQL Server and its components -- https://bit.ly/2oAjKgW @@ -328,10 +329,10 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -343,6 +344,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql index 4336b70506..533a98ea0f 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql @@ -1,7 +1,7 @@ -- SQL Server 2022 Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2024 +-- Last Modified: June 14, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -328,10 +328,10 @@ FROM sys.dm_server_accelerator_status WITH (NOLOCK) OPTION (RECOMPILE); -- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], sc.name AS [CategoryName], SUSER_SNAME(sj.owner_sid) AS [Job Owner], -sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], -sj.notify_email_operator_id, sj.notify_level_email, h.run_status, +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], h.run_status, +CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date], RIGHT(STUFF(STUFF(REPLACE(STR(h.run_duration, 7, 0), ' ', '0'), 4, 0, ':'), 7, 0, ':'),8) AS [Last Duration - HHMMSS], -CONVERT(DATETIME, RTRIM(h.run_date) + ' ' + STUFF(STUFF(REPLACE(STR(RTRIM(h.run_time),6,0),' ','0'),3,0,':'),6,0,':')) AS [Last Start Date] +s.[name] AS [Schedule Name], s.[enabled] AS [Schedule Enabled], js.next_run_date, js.next_run_time FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) LEFT OUTER JOIN (SELECT job_id, instance_id = MAX(instance_id) @@ -343,6 +343,12 @@ ON sj.category_id = sc.category_id LEFT OUTER JOIN msdb.dbo.sysjobhistory AS h WITH (NOLOCK) ON h.job_id = l.job_id AND h.instance_id = l.instance_id +LEFT OUTER JOIN msdb.dbo.sysjobs_view AS jv WITH (NOLOCK) +ON jv.job_id = sj.job_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON jv.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON s.schedule_id = js.schedule_id ORDER BY CONVERT(INT, h.run_duration) DESC, [Last Start Date] DESC OPTION (RECOMPILE); ------ diff --git a/dbatools.psd1 b/dbatools.psd1 index a8999f1027..5f52e71240 100644 --- a/dbatools.psd1 +++ b/dbatools.psd1 @@ -11,7 +11,7 @@ RootModule = 'dbatools.psm1' # Version number of this module. - ModuleVersion = '2.1.17' + ModuleVersion = '2.1.18' # ID used to uniquely identify this module GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789' diff --git a/public/Get-DbaRegServer.ps1 b/public/Get-DbaRegServer.ps1 index 5ff607e1fd..ae144a8dea 100644 --- a/public/Get-DbaRegServer.ps1 +++ b/public/Get-DbaRegServer.ps1 @@ -119,7 +119,7 @@ function Get-DbaRegServer { } process { if (-not $PSBoundParameters.SqlInstance -and -not ($IsLinux -or $IsMacOs)) { - $null = Get-ChildItem -Recurse "$(Get-DbatoolsPath -Name appdata)\Microsoft\*sql*" -Filter RegSrvr.xml | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + $null = Get-ChildItem -Recurse "$(Get-DbatoolsPath -Name appdata)\Microsoft\*sql*" -Filter RegSrvr*.xml | Sort-Object LastWriteTime -Descending | Select-Object -First 1 } $servers = @() @@ -303,4 +303,4 @@ function Get-DbaRegServer { Select-DefaultView -InputObject $self -Property $defaults } } -} \ No newline at end of file +} diff --git a/public/New-DbaAgentSchedule.ps1 b/public/New-DbaAgentSchedule.ps1 index 16f7f917a0..f247525eb0 100644 --- a/public/New-DbaAgentSchedule.ps1 +++ b/public/New-DbaAgentSchedule.ps1 @@ -76,28 +76,28 @@ function New-DbaAgentSchedule { FrequencyRecurrenceFactor is used only if FrequencyType is "Weekly", "Monthly" or "MonthlyRelative". .PARAMETER StartDate - The date on which execution of a job can begin. + The date on which execution of a job can begin. Must be a string in the format yyyyMMdd. If force is used the start date will be the current day .PARAMETER EndDate - The date on which execution of a job can stop. + The date on which execution of a job can stop. Must be a string in the format yyyyMMdd. - If force is used the end date will be '9999-12-31' + If force is used the end date will be '99991231' .PARAMETER StartTime - The time on any day to begin execution of a job. Format HHMMSS / 24 hour clock. + The time on any day to begin execution of a job. Must be a string in the format HHmmss / 24 hour clock. Example: '010000' for 01:00:00 AM. Example: '140000' for 02:00:00 PM. - If force is used the start time will be '00:00:00' + If force is used the start time will be '000000' for midnight. .PARAMETER EndTime - The time on any day to end execution of a job. Format HHMMSS / 24 hour clock. + The time on any day to end execution of a job. Must be a string in the format HHmmss / 24 hour clock. Example: '010000' for 01:00:00 AM. Example: '140000' for 02:00:00 PM. - If force is used the start time will be '23:59:59' + If force is used the end time will be '235959' for one second before midnight. .PARAMETER Owner Login to own the job, defaults to login running the command. @@ -379,10 +379,6 @@ function New-DbaAgentSchedule { } } - # Setup the regex - $RegexDate = '(?