Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output file job cleanup time is always $null #633

Open
ashdar opened this issue Jul 9, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@ashdar
Copy link

commented Jul 9, 2019

Bug Report

General Troubleshooting steps

  • Verified running the latest release of dbachecks?

Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()

image

  • Verified errors are not related to permissions?
  • Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System (Name|Version): Windows 7
  • PowerShell Version: 5.1
  • SQL Server (Edition|Version): Standard & Enterprise, SQL 2008 and SQL 2008R2

Steps to Reproduce

I just upgraded this morning from 1.1.173 to 1.2.5.
Run the checks for the Maintenance solution, including the OutputFileCleanup checks.
DbaChecks seems to think that the '$days' value in the command line that the job runs is $null. When compared the the 30 days stored in config policy.ola.outputcleanup, the test fails.

Description of Bug

I have already dug into Maintenance.Tests.ps1. At first I thought that the configuration value was not being read in from psframework correctly. It turns out that was OK. BUT, the code that greps the command line string from the job step seems to never find the value. The regex works, it finds matches.

BUT the .Value seems to be syntactically wrong. The Matches hashtable doesn't work that way.

In short, I think that the line: $days = $Matches[1].Value
should be: $days - $Matches[1]

@ashdar

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

I occurred to me that submitting a patch would be easier than someone trying to decode what I wrote last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.