Skip to content

SSIS commands - Say why they refuse to run on PowerShell 7 - #10665

Open
andreasjordan wants to merge 1 commit into
developmentfrom
fix-ssis-pwsh-message
Open

SSIS commands - Say why they refuse to run on PowerShell 7#10665
andreasjordan wants to merge 1 commit into
developmentfrom
fix-ssis-pwsh-message

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Refs #10662

Problem

Copy-DbaSsisCatalog, New-DbaSsisCatalog and Get-DbaSsisEnvironmentVariable refuse to run on PowerShell 7 with "This command is not supported on Linux or macOS" - also on Windows, which sends the user looking for a platform problem that does not exist.

Mechanism

Unlike the PBM commands (fixed separately), the refusal itself is correct: dbatools.library ships Microsoft.SqlServer.Management.IntegrationServices.dll only under desktop/lib, so the SSIS object model does not exist on pwsh at all. Only the message is wrong.

What changed

The three messages now read "PowerShell Core is not supported because the SQL Server Integration Services object model is only shipped for Windows PowerShell, please use Windows PowerShell." - the wording Install-DbaSqlWatch and Uninstall-DbaSqlWatch already use for the same kind of limitation. The gate ($PSVersionTable.PSEdition -eq "Core") is unchanged.

Each of the three test files gets a unit test that runs only on pwsh and asserts the warning names Windows PowerShell and does not mention Linux. It uses a placeholder instance name, because the gate fires before any connection is attempted.

What deliberately did not change

Nothing is made to work on pwsh here; that would need the assembly in the core library first.

Tests

  • The three unit test files: green under pwsh 7.6.3 (new test runs) and Windows PowerShell 5.1 (new test skipped), through the testing-dbatools harness.
  • Red on old: with the command change stashed, New-DbaSsisCatalog.Tests.ps1 fails with Expected regular expression 'Windows PowerShell' to match [New-DbaSsisCatalog] This command is not supported on Linux or macOS.

Thanks to @JankeUwe for listing these commands in #10662.

created by Claude and reviewed by Andreas Jordan

馃 Generated with Claude Code

Copy-DbaSsisCatalog, New-DbaSsisCatalog and Get-DbaSsisEnvironmentVariable refuse to run on PowerShell Core, which is right: dbatools.library ships Microsoft.SqlServer.Management.IntegrationServices.dll only under desktop/lib, so the SSIS object model does not exist on pwsh. But the message said "This command is not supported on Linux or macOS", which sends a Windows user looking for a platform problem that is not there.

The message now says that PowerShell Core is not supported because the object model is only shipped for Windows PowerShell, and asks for Windows PowerShell - the wording Install-DbaSqlWatch already uses for the same limitation. The gate itself is unchanged.

Each command gets a unit test that runs only on pwsh and asserts the warning names Windows PowerShell and not Linux.

Refs #10662

(do *Ssis*)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant