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

Export-DbaLogin - add 2022 support #9569

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open

Export-DbaLogin - add 2022 support #9569

wants to merge 1 commit into from

Conversation

jpomfret
Copy link
Collaborator

@jpomfret jpomfret commented Jan 3, 2025

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (Invoke-ManualPester)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

The DestinationVersion parameter didn't have 2022 listed, no code in the function needs to change as we just check if it's older versions and then skip one section.

We can probably improve this going forward - but this is a quick fix to get John back on track
https://bsky.app/profile/sqlmct.bsky.social/post/3letxumb4f22c

Approach

Added the missing value to the parameter

@jpomfret
Copy link
Collaborator Author

jpomfret commented Jan 6, 2025

Failed test is unrelated - looks like it needs fixing so it doesn't just specify the first process but filters to get the one the test is looking for

image

$results = Get-DbaExternalProcess -ComputerName localhost | Select-Object -First 1

@niphlod
Copy link
Contributor

niphlod commented Jan 7, 2025

PR is good but unfortunately I think the original issue can only be resolved upgrading our library that bundles SMO to support 2022.

@jpomfret
Copy link
Collaborator Author

jpomfret commented Jan 7, 2025

This command doesn't do anything differently for 2022 vs 2019 though - it's only using that parameter to exclude things for older versions

Both these spots - this PR just adds the option to the parameter.

https://github.com/dataplat/dbatools/blob/development/public/Export-DbaLogin.ps1#L411

https://github.com/dataplat/dbatools/blob/development/public/Export-DbaLogin.ps1#L520

tbh - it would probably be better to write this slightly cleverer (if that's a word) - so we don't need to remember to add new versions - perhaps something like this, but I don't love that 😆

[ValidateSet('SQLServer2000', 'SQLServer2005', 'SQLServer2008/2008R2', 'NewerThan2008R2')]

@niphlod
Copy link
Contributor

niphlod commented Jan 7, 2025

I concur but "nicer design pattern" for this function is another unrelated thing for what I think it's the root cause #9568

@jpomfret
Copy link
Collaborator Author

jpomfret commented Jan 7, 2025

Hmm - I hadn't seen that discussion, I was tagged on bluesky about it not showing up for the -DestinationVersion.

Wonder if this is the same issue or not, I will see if I can replicate locally (probably tomorrow at this point) and get back to you. Thanks for connecting the two!

@potatoqualitee
Copy link
Member

ughhhhh that library is just hell to upgrade and even the SqlServer module is running into compat issues bc Azure is so mixed in. I'll have time to address this in March so if anyone else would like to jump in, that'd be fab (@niphlod had messaged me previously). I just open Visual Studio then say update but then I also have to match it up with sqlpackage and SpaghettiDBA's DLLs. It's truly hell and pushes the limits of my skillset.

@potatoqualitee
Copy link
Member

I think @spaghettidba mentioned he'd be doing a nuget package but I'm not finding XESmartTarget there.

If not, I think we'll also need to update his packages too in our library which may require and update in the build file to https://github.com/spaghettidba/XESmartTarget/releases/download/v1.5.7/XESmartTarget_x64.msi

@potatoqualitee
Copy link
Member

oh also we need to add 2025 support 😭

@spaghettidba
Copy link
Contributor

I think @spaghettidba mentioned he'd be doing a nuget package but I'm not finding XESmartTarget there.

I tried. Multiple times. I watched videos, I read articles. Apparently I'm not smart enough to create a nuget package.
I'm more than willing to do that, I just seem to be unable to. 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants