Install-DbaParquet - Keep the assemblies of the two PowerShell editions apart - #10538
Merged
Conversation
…ns apart Install-DbaParquet picks the assemblies that match the runtime it runs on, .NET Framework targets on Windows PowerShell and net<major> targets on PowerShell 7, but installed all of them into one folder that both editions share. Whichever edition installed last therefore broke the other one, and the lab hit exactly that: an install made from PowerShell 7 left Parquet.dll and six of its dependencies referencing System.Runtime and System.Collections 10.0.0.0, which .NET Framework cannot bind, so every single import failed on Windows PowerShell with a type load error that reads like a missing installation. Each edition now installs into its own folder below the configured path, and Get-DbaParquetPath prefers the folder of the running edition and only falls back to the flat folder for installations made before the split. Reporting an installation as present now looks at the folder that would be written to rather than at any folder Get-DbaParquetPath knows, because otherwise the assemblies of the other edition counted as installed and there was no way out of the failure except deleting the folder by hand. Import-DbaParquet names the likely cause when assemblies are present but cannot be loaded. Verified in the lab: Import-DbaParquet.Tests.ps1 goes from 2 of 17 to 17 of 17 on Windows PowerShell 5.1 and stays at 17 of 17 on PowerShell 7.4 through the fallback. (do *Parquet*) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 8, 2026
Merged
Member
|
thank you 🙏🏼 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Import-DbaParquetfailed every import on Windows PowerShell in the lab - 2 of 17 tests passing - whilethe same file passed 17/17 on PowerShell 7. The warning said the assemblies could not be loaded:
The cause
Install-DbaParquetpicks the assemblies that match the runtime it is running on: .NET Framework targets onWindows PowerShell,
net<major>targets on PowerShell 7. That part works. But it installed all of them intoone folder that both editions share,
Path.DbatoolsParquet, default<AppData>\PowerShell\dbatools\parquet.So whichever edition installs last decides what the other one finds. This installation had been made from
PowerShell 7, which left
Parquet.dlland six of its dependencies as thenet10.0builds. Those referenceSystem.RuntimeandSystem.Collections10.0.0.0, which .NET Framework cannot bind, so Windows PowerShellcould not load them at all.
Nothing was wrong with the package versions, and
Parquet.dllwas exactly the pinned 5.4.0 - which is whythis reads like a broken or missing installation rather than a layout problem.
The fix
Each edition installs into its own folder below the configured path,
desktoporcore, chosen by the newprivate function
Get-DbaParquetEditionFolder.Get-DbaParquetPathlooks in the folder of the runningedition first and falls back to the flat folder, so installations made before this change keep working.
Reporting an installation as already present now looks at the folder that would be written to rather than
at any folder
Get-DbaParquetPathknows about. Without that, the other edition's assemblies counted asinstalled and
Install-DbaParquetskipped the install - so the command told you to runInstall-DbaParquet,and
Install-DbaParquetthen said it was already installed, with no way out except deleting the folder byhand.
Import-DbaParquetalso names the likely cause now when the assemblies are present but cannot be loaded, andthe help of
Install-DbaParquetsays which assemblies it installs and that both editions need their own run.An explicit
-Pathis still used exactly as given.Testing
In a lab with SQL Server 2019/2022/2025:
Import-DbaParquet.Tests.ps1on Windows PowerShell 5.1Import-DbaParquet.Tests.ps1on PowerShell 7.4Install-DbaParquet.Tests.ps1The PowerShell 7 run deliberately used the pre-existing flat installation to confirm the fallback keeps old
installations working.
Install-DbaParquet.Tests.ps1gains a test that installing without-Pathlands in a subfolder named for therunning edition.
Note
Unrelated to this PR, but found next to it:
Import-DbaParquetfollowed byNew-DbaDacPackagein oneWindows PowerShell process crashes the process with an access violation. That survives this fix and is
tracked in #10536.
🤖 Generated with Claude Code