Skip to content

Conversation

shamil-mubarakshin
Copy link
Contributor

Description

This PR adds Microsoft OLE DB Driver 19 to windows images

Related issue: #12992

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

@shamil-mubarakshin shamil-mubarakshin marked this pull request as ready for review October 2, 2025 18:54
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 18:54
Copy link
Contributor

@Copilot Copilot AI left a 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.

Comment on lines +124 to +133
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
}

Copy link
Preview

Copilot AI Oct 2, 2025

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.

Suggested change
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.

Comment on lines +124 to +132
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
}
Copy link
Preview

Copilot AI Oct 2, 2025

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.

@shamil-mubarakshin shamil-mubarakshin merged commit de257bb into actions:main Oct 3, 2025
14 of 15 checks passed
@shamil-mubarakshin shamil-mubarakshin deleted the windows-add-oledb-19 branch October 3, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants