-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[windows] Add SQL OLEDB Driver 19 #13127
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
[windows] Add SQL OLEDB Driver 19 #13127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds Microsoft OLE DB Driver 19 to Windows images alongside existing Driver 18, updating installation, reporting, and tests to track both versions distinctly.
- Split previous single version query into separate functions for Driver 18 and 19
- Updated software report generation and tests to surface both versions
- Extended install script to install both driver versions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| images/windows/scripts/tests/Tools.Tests.ps1 | Adds discrete Pester tests for Driver 18 and new Driver 19 registry keys |
| images/windows/scripts/docs-gen/SoftwareReport.Tools.psm1 | Replaces single retrieval function with two version-specific functions |
| images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 | Reports both driver versions separately in generated software report |
| images/windows/scripts/build/Install-SQLOLEDBDriver.ps1 | Adds installation steps for Driver 19 alongside Driver 18 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| function Get-SQLOLEDBDriver18Version { | ||
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL' InstalledVersion).InstalledVersion | ||
| return $SQLOLEDBDriverVersion | ||
| } | ||
|
|
||
| function Get-SQLOLEDBDriver19Version { | ||
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL19' InstalledVersion).InstalledVersion | ||
| return $SQLOLEDBDriverVersion | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] These two functions duplicate all logic except the registry key path. Consider consolidating into a single parameterized function (e.g., Get-SQLOLEDBDriverVersion -Major 18|19) to reduce repetition and future maintenance overhead.
| function Get-SQLOLEDBDriver18Version { | |
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL' InstalledVersion).InstalledVersion | |
| return $SQLOLEDBDriverVersion | |
| } | |
| function Get-SQLOLEDBDriver19Version { | |
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL19' InstalledVersion).InstalledVersion | |
| return $SQLOLEDBDriverVersion | |
| } | |
| function Get-SQLOLEDBDriverVersion { | |
| param( | |
| [Parameter(Mandatory=$true)] | |
| [ValidateSet(18, 19)] | |
| [int]$Major | |
| ) | |
| if ($Major -eq 18) { | |
| $regPath = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL' | |
| } elseif ($Major -eq 19) { | |
| $regPath = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL19' | |
| } else { | |
| throw "Unsupported major version: $Major" | |
| } | |
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path $regPath InstalledVersion).InstalledVersion | |
| return $SQLOLEDBDriverVersion | |
| } |
Copilot uses AI. Check for mistakes.
| function Get-SQLOLEDBDriver18Version { | ||
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL' InstalledVersion).InstalledVersion | ||
| return $SQLOLEDBDriverVersion | ||
| } | ||
|
|
||
| function Get-SQLOLEDBDriver19Version { | ||
| $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL19' InstalledVersion).InstalledVersion | ||
| return $SQLOLEDBDriverVersion | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original Get-SQLOLEDBDriverVersion function was removed/renamed, which may be a breaking change for any external scripts/modules consuming this tooling. Provide a backward-compatible alias (e.g., reintroduce Get-SQLOLEDBDriverVersion calling Get-SQLOLEDBDriver18Version) to avoid breaking existing automation.
Copilot uses AI. Check for mistakes.
Description
This PR adds Microsoft OLE DB Driver 19 to windows images
Related issue: #12992
Check list