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
Install-DbaMaintenanceSolution Ignores -WhatIf #4901
Comments
This is because this line is added to the function but the logic itself was not written to handle it. |
We should fix the parameter usage as well. This combination should be required We have an example that shows ReplaceExisting will drop everything, but I don't think this is common practice with Ola's objects and jobs. The deployment script for the jobs is a basic example, and not one I use with any client or system out of the box. I always go and modify that command to what I need it to handle. The main deployment script does not allow for advanced configurations (e.g. you can't deploy using Backup To URL without modifying the backup command in the jobs created). Shoot when I want to go update to the latest version of the code I just go to GitHub and pull the procedures and just run those scripts to update the objects. So with all that, I'd say |
@wsmelton I looked into your comments. I am not sure how to implement that without making it overly complex. InstallJobs already has a default of false. This is already implemented, but with the parameter -InstallJobs instead of -Force. -Force has already a different meaning and changing that would be complicated. An issue that I would have a problem with is that it is not possible to just update the stored procedures without dropping/creating the table:
|
I can address it at a later time if @potatoqualitee would like the adjustment to be implemented. |
Before submitting a bug report:
powershell -NoProfile
)Steps to Reproduce
Running this code against the database where I have installed Ola Hallengren's Maintenance Solution:
Shows that the Ola stored procedures associated were created at 2:38PM:
Then I run this to reinstall the sprocs (but not the agent jobs), but I specify
-WhatIf
to see what'll happen:And the output sure looks like it made changes.
Let's confirm that changes were made by running the same
Find-DbaStoredProcedure
again:Sure enough, the create date has changed from 2:38PM to 2:42PM. It dropped and recreated these sprocs even though
-WhatIf
was used.Expected Behavior
Using
-WhatIf
should not make any permanent changes.Actual Behavior
Stored procedures are dropped and recreated.
Environmental data
PowerShell:
SQL Server:
Microsoft SQL Server 2016 (SP2-CU2) (KB4340355) - 13.0.5153.0 (X64)
Standard Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor)
The text was updated successfully, but these errors were encountered: